Access parameter query and wildcards

ssblue
ssblue used Ask the Experts™
on
Access - I have a report with a parameter query and sometimes I want everything instead of just one thing.
Example: I may want all "Crafts" and one "Tag Number"    or   One "Craft" and all "Tag Numbers"

Is there a way to use wildcards so I don't have to go in and change the query every time?

See attachment
AccessParameterQuery.PNG
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Jim Dettman (EE MVE)President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012

Commented:
Been a long time since I did it that way, but if memory serves, just leaving it blank when it prompts should do it.

Jim.
Jim Dettman (EE MVE)President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012

Commented:
Actually I just tried it and it doesn't.

Add a column with the parameter name, then underneath add an "OR" condition of IS NULL:

Region-Capture.jpg
Jim.
President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012
Commented:
BTW, if you write it this way:

[Enter days] or [Enter days] Is Null

When you save the query, the designer will split that out into multiple columns on it's own.   but you may find it easier to do it that way if you have a lot of conditions.

Also, don't leave all those fields set to 'GROUP BY' - it's going to try and sort on the first 10.

Jim.
Jim Dettman (EE MVE)President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012

Commented:
and one more thought; you can use "Like" for the criteria check and then type an *:

Like [Enter Days]

and get all records that way, but like is a pretty good performance hit.   Might want to use it though if you only have one or two criteria checks.

Jim.
ssblueCoordinator

Author

Commented:
Thanks for all the information.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial