Conditional query criteria from field on form

  • Thread starter Thread starter Eusi
  • Start date Start date
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
 
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).
 
Back
Top