Search Query with Criteria

R

Roplab

Hi Everyone,
I have a table that has a field name Notify, the field
contains value that separated by comas(i.e HYJ,KLM,THM,GHM)
I need to create a querry that all you to user to input any(i.e KLM) of
the items in the above field, the query should display any record that has
the notify field input. Is there a way to create a criteria to handle that
query.

Thanks
 
T

Tony Vrolyk

I assume you know how to setup a basic query.

In the criteria for the Notify field type
Like "*KLM*"

Tony
 
R

Roplab

The problem is that KLM is not the only search criteria that may be used
someone might type any of the other content of the field (HYJ,KLM,THM,GHM).
So if some type HYJ as an input it will not get query result because of the
LIKE "*KLM*"
 
J

John Spencer (MVP)

Simplest way, but maybe not the best.

Criteria: LIKE "*" & [Enter search string] & "*"

That is a parameter query and the user will get a dialog asking them to input
the search string. Whatever they enter will be matched. So if the enter only
"m", you will get matches on KLM, THM, and GHM. Only "h" will match on HYJ,
THM, and GHM.
 
R

Roplab

Thanks John, it works fine.

John Spencer (MVP) said:
Simplest way, but maybe not the best.

Criteria: LIKE "*" & [Enter search string] & "*"

That is a parameter query and the user will get a dialog asking them to input
the search string. Whatever they enter will be matched. So if the enter only
"m", you will get matches on KLM, THM, and GHM. Only "h" will match on HYJ,
THM, and GHM.
The problem is that KLM is not the only search criteria that may be used
someone might type any of the other content of the field (HYJ,KLM,THM,GHM).
So if some type HYJ as an input it will not get query result because of the
LIKE "*KLM*"

KLM)
of that
has handle
that
 
Top