I am trying to do something similar.
I want a user to be able to choose a value from a table and then do a query
on the main table looking for records which have the chosen value somewhere
in one of several fields. To keep it simple, I will give an example using the
Parameter field.
I would like to have the user select a value for [Param] on a form, press
the GetRecords button and display only those records which contains the
keyword chosen from the Param list which in the Resp2Comm.Param field of the
master table. So,
if the user selects CPO, the query should look for records Like "*CPO*"
Here is my attemp to perform this query:
SQL = "SELECT Resp2Comm.Param, Resp2Comm.Comment, Resp2Comm.Response FROM
resp2comm WHERE ((Resp2Comm.Param = " & Chr(34) & "Like " & Chr(34) & "*" &
Me![Param] & "*" & Chr(34) & "));"
I get a Syntax error in string in query expression '((Resp2Comm.Param =
"*CPO*"));'. error message. I've tried various alternate coding using the "
and ' characters; but do not seem to be able to resolve this error.
Thanks for any and all help with this problem.