Make a blank criteria field return all instead of nothing

  • Thread starter Thread starter adr147
  • Start date Start date
A

adr147

I am in the process of making a form that someone can use to inpu
information into which will then result in the criteria for a report.
However, I cannot figure out how to code the criteria specifics so tha
a blank field returns all files of the database instead of none.

I have tried working with some iif statements but have not yet had an
luck. If anyone has any information I would greatly appreciate th
help.

Thanks, Andre
 
Andrew,

In your query criterion, where you have:
Forms![SomeForm]![SomeControl]

change to:
Like Forms![SomeForm]![SomeControl] & "*"

HTH,
Nikos
 
You've got to deal with the null semantics.

If the field you're collecting criteria into is empty, then you must decide,
does this mean the user is looking for the empty value (whatever that
means), or does not care about that field.

If you decide it means the user does not care about that vield, then simply
do not include it in the criteria that you build.

Good luck

{Malcolm}
 
I am in the process of making a form that someone can use to input
information into which will then result in the criteria for a report.
However, I cannot figure out how to code the criteria specifics so that
a blank field returns all files of the database instead of none.

Databases don't contain "files". I'm not completely certain what
you're asking!

If you want to search for *records* in a table using a form control as
criteria, and return all records if the control is blank, use a
criterion of

=[Forms]![Formname]![ctrlnm] OR [Forms]![Formname]![ctrlnm] IS NULL
 
Back
Top