MS Access Query using a Like statement.

MS Access query issue. I have a form that requires someone to enter an IP address in a field to do a lookup. So I need the query to use that form field. In the table that contains the IP addresses, some of the IP address are preceded by other characters, some do not. I need for the criteria in the query to use something along the lines of, Like "*[forms]![Lookup]![IP]*", but that doesn't work. Is there a way to get the results I'm looking for? I need were the IP address is any part of the field.
dgravittAsked:
Who is Participating?
 
Anders Ebro (Microsoft MVP)Microsoft DeveloperCommented:
Your query should look like
like "*" & Forms!Lookup!ip & "*"

Open in new window


Note how that expression concatenates to give you the desired expression.
1
 
dgravittAuthor Commented:
Worked great, thanks for the quick response.
0
 
Anders Ebro (Microsoft MVP)Microsoft DeveloperCommented:
Your welcome. Don't forget to close the question, so others don't waste time :)
0
All Courses

From novice to tech pro — start learning today.