Parameter Query - if Null show all

QBC

New member
Local time
Today, 11:40
Joined
Aug 23, 2009
Messages
9
Hello everyone,
Im running a parameter query and I need it to show all records if left blank by the user.
I can achieve this but I cannot achieve it for more than one parameter.
How do i go about this?

Basically, if the user enters a value for the first parameter and enters nothing on the second one, i'd like to see all values for the first parameter.

any thoughts?

as always, much appreciated.
 
Use;
Code:
Like [URL="http://www.techonthenet.com/access/functions/advanced/nz.php"]Nz[/URL]([Enter a Search Value],"*")
as you criteria. If you want all values from a field that is left blank you will need to step each of your Criteria down one line so that you have an Or operator rather than an And operator
 
Love the simplicity and it works so well.
Thank you so much!:o
 
It may be simple but I would not use it as Like can bring back partial string matches. Also to quote Pat Hartman

1. Do NOT use LIKE unless you really need it. It can cause full table scans and prevent Jet/ACE from using any indexes. If you need it, you need it, and are willing to pay the price but it should NEVER be your default.

I always use

Field = parameter or parameter is null
Type syntax

Brian
 

Users who are viewing this thread

Back
Top Bottom