Q: Downloaded Database Tip
Hi! I downloaded a file that you have in the database tip
section, the tip file was called "Search for a word in all text
fields". My question is you have a place for the user to place
a check mark and reading the code I cannot figure out what the
check mark is suppose to do. I have searched with it and
without it but seem to get the same results. Could you
please explain the two dummy search sections of the code and
the difference, Where and or, Seems like i am getting the
same search results. Thanks, Phil
Philip Price; phillipprice@mindspring.com
A:
the chechmark is for checking on 'whole words only'. That's way the the code is different:
the first check is for exact match; the second (with the LIKE keyword) is for match any..
If frmFind.Check1.Value = 1 Then
If blnFirst Then
strDummy = strDummy & " WHERE (" & rs.Fields(intX).Name & " = '" & strZoek & "')" blnFirst = False
Else
strDummy = strDummy & " OR (" & rs.Fields(intX).Name & " = '" & strZoek & "')"
End If
Else
If blnFirst Then
strDummy = strDummy & " WHERE (" & rs.Fields(intX).Name & " LIKE '*" & strZoek & "*')" blnFirst = False
Else
strDummy = strDummy & " OR (" & rs.Fields(intX).Name & " LIKE '*" & strZoek & "*')"
End If
End If
BTW; It was not supposed to be in the example...
Return