how to use a prompt and like in query? ex: like "* [blabla] *"

D

David M

I can not find how to associate a wild character with a prompt in my query

my command in criteria will be something like:

like * [prompt the user] *

Please help :)
 
D

David M

Found it :)


I was wondering if there is a way to add a like operator to a prompt in a
query such that if you are looking for a record that has a ##CC###
combination and you only know the two middle characters when you are prompted
to to enter in the combination you can do a wildcard type of search %DT% and
it will return every entry with a DT combination it in?
thanx

Sure - but you need to put the LIKE outside the prompt.

Try a criterion of

LIKE "*" & [Enter two letter code:] & "*"

Note that Access/JET uses * rather than % as its wildcard (unless
you've set the database's Query options to ANSI compliant).

John W. Vinson[MVP]





David M said:
I can not find how to associate a wild character with a prompt in my query

my command in criteria will be something like:

like * [prompt the user] *

Please help :)
 
J

John Spencer

Try

like "*" & [prompt the user] & "*"

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top