Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show all unless selction...

Status
Not open for further replies.

geckodfw

Technical User
Oct 12, 2001
17
US
I need a criteria that will show all the records if a criteria is not entered.

If the region "CANADA" is entered into a parameter, then show only "CANADA". If nothing is entered into the parameter, show all the records.

I have tried

IIF(IS NOT NULL, [parameter], "")

I am stuck. Help!

Thanks.
 
Yes, it's a query in Access 2000. Sorry about that. :)
 
Hi There: Maybe I am missing something, but if you want to show all the records, there should be nothing entered in the Criteria row on the query. Let me know more details...

beth@integratedresourcemgmt.com
 
I want to be able to select records from the table based on a parameter. If there is data in the parameter, I want only records based on that data returned. If there is nothing in the parameter, I want all the records returned.

If the user inputs wants to get "CANADA" they will type in "CANADA" for the parameter. If they don't type anything in, then they want to see ALL the regions.
 
Hi There:

So, are the users using the query to enter criteria? Also, I am assuming this query is not working, correct?

Feel free email your database - can you zip it up and send it to me.

Beth beth@integratedresourcemgmt.com
 
Hi Again- One more thought... Are you linking tables in the query? If so, you may need to change the Join Properties.

Beth beth@integratedresourcemgmt.com
 
Try this in the criteria of your query:
Code:
Like [parameter] & '*'
If nothing is entered, all records will be returned, and if 'CANADA' is entered all records STARTING with CANADA will be returned......

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top