using query conditions to return a specific value or all values

G

Guest

using Access 2002...
I am trying to construct a query, using criteria which is selected from a
combo box on a form. If a value is selected in the combo box, then the query
will return only the value selected, but if no value is selected in the combo
box (therefore the combo box has a null value) then the query will return all
values. Using an IIF statement in the query criteria field, I can get the
query to return the appropriate results if a value is selected from the combo
box, but I am not able to return all values if nothing is selected in the
combo box
 
K

Ken Snell [MVP]

Use this as the criterion expression:

[Forms]![FormName]![ComboBoxName] Or [Forms]![FormName]![ComboBoxName] Is
Null
 
G

Guest

Thank you very much Ken
Your help is much appreciated!
AC

Ken Snell said:
Use this as the criterion expression:

[Forms]![FormName]![ComboBoxName] Or [Forms]![FormName]![ComboBoxName] Is
Null
--

Ken Snell
<MS ACCESS MVP>


ac512 said:
using Access 2002...
I am trying to construct a query, using criteria which is selected from a
combo box on a form. If a value is selected in the combo box, then the
query
will return only the value selected, but if no value is selected in the
combo
box (therefore the combo box has a null value) then the query will return
all
values. Using an IIF statement in the query criteria field, I can get the
query to return the appropriate results if a value is selected from the
combo
box, but I am not able to return all values if nothing is selected in the
combo box
 

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