combine prompt with Like operator?

G

Guest

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
 
J

John Vinson

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]
 

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