Return all records in a parameter query

A

Alex

I'm going crazy. I know there's a way to add criteria in a parameter query
that will return all records if the parameter box is left blank. I've done
it before but I can't find it in the help system or in here (surely because
I'm typing my question incorrectly).

I have a field called Bldg. I'd like people to type a bldg. or to leave it
blank and return all records. I'm not using a form, just a plain old
parameter.

Thanks in advance for your help.
 
D

Douglas J. Steele

WHERE Bldg = [What Building?] Or [What Building?] Is Null

Note that it's critical that the two references to the parameter be typed
identically.

You can also extend the above so that they only have to type in part of the
Building Name:

WHERE Bldg Like "*" & [What Building?] & "*" Or [What Building?] Is Null
 

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