getting all if parameter not selected

J

JohnE

I have a query that is behind a report. In the query designer there is a way
to indicate if nothing is selected from the parameter, all records will be
returned. It has been a long time since working on this that I have
forgotten what is added. If anyone is familiar with what is used, I can use
the help.
Thanks for the response and help.
.... John
 
A

Allen Browne

Actually, Dennis, that won't do it.
Any rows where the field is null (nothing there) will not be returned.

A workaround is to change the WHERE clause of the query like this:
WHERE ([Enter Data] & "" = "") OR ([Field2] = [Enter Data])

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Dennis said:
Like "*" & [Enter data] & "*"

JohnE said:
I have a query that is behind a report. In the query designer there is a
way
to indicate if nothing is selected from the parameter, all records will
be
returned. It has been a long time since working on this that I have
forgotten what is added. If anyone is familiar with what is used, I can
use
the help.
Thanks for the response and help.
... John
 
K

Klatuu

If the query is the record source for a report, I would sugges removing the
criteria from the query and use the Where argument of the OpenReport method
to provide the filtering.
 
Top