I am getting this Syntax error (Missing Opertor), but i'm not sure what it
is, can you help? Should I post in another location? Is this enough code or
should I enter all of it?
strFilter = "[testnumonic]" & strtestnumonic & "[tissuetype]" &
strtissuetype & "[Deficiency]" & strDeficiency & " And [dDiagnosisName]" &
strdDiagnosisName & " "
DLS
The Filter ahould be a valid SQL WHERE clause without the word WHERE,
but with all the needed operators (=, >, <, LIKE, etc.)
You don't say what's in the values named strtestnumonic,
strtissuetype, etc. but if they contain XYZ, Liver, Ascorbate and
Scurvy, you'll build a string
[testnumonic]XYZ[tissuetype]Liver[Deficiency]Ascorbate AND
[dDIagnosisname]Scurvy
which doesn't make sense either medically or in database terms.
Since I don't know what operators you want, or what the variables
contain, I can't be sure this is correct - but I'd guess you want
something more like
strFilter = "[testnumonic] = '" & strtestnumonic &
"' AND [tissuetype] = '" & strtissuetype &
"' AND [Deficiency] = '" & strDeficiency &
"' And [dDiagnosisName] = '" & strdDiagnosisName & "'"
Note that for filtering a Text datatype field must be delimited by '
or "; to get a " delimiter inside a string itself delimited by ", you
need to use two consecutive ", so to handle a diagnosisname like
Crohn's Disease you should use
"' And [dDiagnosisName] = """ & strdDiagnosisName & """"
John W. Vinson[MVP]