String search in Access [RESOLVED]
Hi, I am trying to search 3 possible strings in a table from a data base. Do you know the code to specify the search?. I am looking for something like a Instr, but for a search:
Code:
Set rsCan = dbtrad.OpenRecordset("SELECT * FROM TDOKUMENTE WHERE String1 exists or String2 exists or String3 exists")
The text in red!!!, how do I make that search with that chriteria?
Thanks in advance!.
Yorch
Re: String search in Access
The basic syntax is
SELECT * FROM TDOKUMENTE WHERE [somefield] LIKE "*" & String1 & "*"
Hope this helps...
Re: String search in Access
You need to use single quotes around your criteria if its a text field.
SELECT * FROM TDOKUMENTE WHERE [somefield] LIKE "'*" & String1 & "*'"
Re: String search in Access