Conditional query criteria from field on form

E

Eusi

Hello

I've got a query that has a criterion that is linked to a field on a form.
If the field is populated, then the query works fine and filters accordingly.
If the field is blank, then the query is rightly applying the "is null"
filter.

What I'd like it for the query to apply the filter if the field is populated
but ignore it if it is empty.

Any thoughts?

Thanks
 
M

Marshall Barton

Eusi said:
I've got a query that has a criterion that is linked to a field on a form.
If the field is populated, then the query works fine and filters accordingly.
If the field is blank, then the query is rightly applying the "is null"
filter.

What I'd like it for the query to apply the filter if the field is populated
but ignore it if it is empty.


Try this kind of criteria for the query's field:

=Forms!theform.thetextbox OR Forms!theform.thetextbox Is
Null

FYI tables and queries have fields (columns) but forms and
reports have controls (text box.labels,etc).
 

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