Specifying Criteria

L

Lost In Queries

I have created a Select Query which prompts users for a
specific test type from the main table. This portion
works as expected. How can I construct the query so that
if the user wants to see all records, they can just hit
enter at the prompt and the records would be displayed?

thanks in advance

john
 
R

Rick B

make your criteria like...


Like [EnterSomeData] & "*"



If the user enters "SMITH" the query would return all records where the
entry starts with SMITH (like "SMITH*")

If the user leaves it blank, all records would be returned (like "*")


Rick B

I have created a Select Query which prompts users for a
specific test type from the main table. This portion
works as expected. How can I construct the query so that
if the user wants to see all records, they can just hit
enter at the prompt and the records would be displayed?

thanks in advance

john
 
G

Guest

Heres a better way which uses a special chacracter (in
this case '%') for 'all'. In addition, you only get exact
matches when you put in your criteria (the last reply to
your question would return smith, smithson, smithe, etc.)

WHERE (([Account].Acct_ID)=[Enter ID or % for all]) OR
(("%")=[Enter ID or % for all]);

DOTJake
 
Top