A parameter that can be blank.

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
 
W

Wayne Morgan

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.
 

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