Null criteria in a Query does not work

  • Thread starter Thread starter RFJ
  • Start date Start date
R

RFJ

I've got an unbound field in a form - the value of which is picked up by a
query as a criteria. That part of the query works.

If that unbound field is empty I want the query to show all records but at
the moment it shows none.

I've been looking at posts on a similar topic but can't seem to get the code
below working.

Can SKS tell me where I'm going wrong

TIA

Rob

=([Forms].[Mainform for criteria selection].[Survey Group]) Or ("Where
[Mainform for criterial selection].[Survey Group]" Is Null)
 
Dear Rob:

I think it should be:

=[Forms]![Mainform for criteria selection]![Survey Group] OR
Nz([Forms]![Mainform for criteria selection]![Survey Group], "") = ""

This tests for whether the control is NULL or empty. In some cases it
can be either, and look the same: empty.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
Back
Top