A parameter that can be blank.

  • Thread starter Thread starter Gez
  • Start date Start date
G

Gez

Hi,

I'm running a query by form with a parameter obtained from a combo box. If
the combobox is empty then I want all values returned. What is the best way
of tackling this. I've tried setting it to null, empty, nothing etc but the
query is looking for these as values and not returning everything. The
value in question is an integer field but it would be useful to know how to
do this for strings as well.

Cheers,

Gez
 
One option is to use Like,

Like Nz(Forms!Form1!cboCombobox, "*")

This will return * if the combo box is Null, causing Like to look for
everything.
 
Back
Top