Null criteria in a Query does not work

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)
 
T

Tom Ellison

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
 

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