simple select query variable question

J

John

I haven't used Access in a couple of years but I used to know how to do
this.

Very simply I have one table of Products and I want to enter Criteria into
the Name field that will cause a dialog box to open when the query is run,
so that I can find a product by entering any part of it's name.

For today I was just entering:

Like "*search string*"

into the Criteria box, which works fine, but I want to be able to automate
this by making the query prompt me for the seach string instead of having to
modify it in Design View each time.

Thank you
 
J

Jerry Whittle

Like "*" & [Enter the Product] & "*"

If you enter nothing, it should return all records.
 
B

Bob Barrows [MVP]

John said:
I haven't used Access in a couple of years but I used to know how to
do this.

Very simply I have one table of Products and I want to enter Criteria
into the Name field that will cause a dialog box to open when the
query is run, so that I can find a product by entering any part of
it's name.
For today I was just entering:

Like "*search string*"

into the Criteria box, which works fine, but I want to be able to
automate this by making the query prompt me for the seach string
instead of having to modify it in Design View each time.
Like "*" & [Enter Search String] & "*"
 
J

John

Thanks everybody!


Bob Barrows said:
John said:
I haven't used Access in a couple of years but I used to know how to
do this.

Very simply I have one table of Products and I want to enter Criteria
into the Name field that will cause a dialog box to open when the
query is run, so that I can find a product by entering any part of
it's name.
For today I was just entering:

Like "*search string*"

into the Criteria box, which works fine, but I want to be able to
automate this by making the query prompt me for the seach string
instead of having to modify it in Design View each time.
Like "*" & [Enter Search String] & "*"
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
 

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