Hi,
I have created a search form where people can search for company names. It works fine but I try to search for a company like l'amour then it goes wrong. I get following error
Run-time error '3075':
Syntax error (missing operator) in query expression 'vstNaam LIKE '*l'amour*';'.
I see that it expects a closing ' but how can I get around it? It is part of the search argument.
Here is the code I use: ZoekArgument = search argument = l'amour
I hope someone can help me!
grtz jayke
I have created a search form where people can search for company names. It works fine but I try to search for a company like l'amour then it goes wrong. I get following error
Run-time error '3075':
Syntax error (missing operator) in query expression 'vstNaam LIKE '*l'amour*';'.
I see that it expects a closing ' but how can I get around it? It is part of the search argument.
Here is the code I use: ZoekArgument = search argument = l'amour
Code:
strSQL = "SELECT tblVestigingen.vstVestigingsID, tblVestigingen.vstNaam, tblVestigingen.vstLocStraat, " & _
"tblVestigingen.vstLocHuisnr, tblVestigingen.vstLocPostcodeID " & _
"INTO tblZoeken " & _
"FROM tblVestigingen WHERE " & ZoekOpdracht & " LIKE '*" & ZoekArgument & "*';"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
I hope someone can help me!
grtz jayke