I need a complex query from a table
The first part alone works well
The second alone works well
but if I joint the two, does not work and I have I sintax error
Note.- in this case stLinkCriteria is the first one of course
I am missing something in the sintax . Can you help? Thanks
The first part alone works well
Code:
Dim fechainicial As Date
Dim stDocName As String
Dim stLinkCriteria As String
fechainicial = Text207
fechafinal = Text209
stDocName = "Incidenciasenlabasededatos"
stLinkCriteria = "[Fecha]>=#" & fechainicial & "#" & " And " & "[Fecha]<=#" & fechafinal & "#"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Code:
If Texto167 = "Técnica" Then
stLinkCriteria = "[Tipo de incidencia]='Técnica'"
End If
Code:
stLinkCriteria = stLinkCriteria & " And " & "[Tipo de incidencia]='Técnica'"
or
stLinkCriteria = [B]stLinkCriteria[/B] & " Where " & "[Tipo de incidencia]='Técnica'"
MsgBox (stLinkCriteria)
I am missing something in the sintax . Can you help? Thanks
Comment