Filtering Records with a Form

D

David

I am using the following syntax in the field criteria
within a query:

IIf([Forms]![FormName]![FormControl] Is Null,"",[Forms]!
[FormName]![FormControl])

I want to filter the records if the control is not null,
and return all records if the control is null. What is
happening is that if the control is not null, it filters
correctly, but if the control is null, no records are
returned.

Can someone tell me what I am doing wrong?

Thanks for your help in advance.
 
G

Guido

The way you have it written it is looking for an empty
string in that field "".

Try this:

IIf([Forms]![FormName]![FormControl] Is Null,[myTable]!
[myField],[Forms]![FormName]![FormControl])

Instead of "" for the true condition use
!
[fieldname] using a field that has all possible criteria
for your query.

HTH
 

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