Iif trouble

G

Guest

Im trying to query a table with one of the criteria being from a Combo box in
a form. There are 2 options in the field, but if the user leaves it blank, I
want to pull both options. Right now, I have
Iif([Forms]![Main].[Combo35] Is Null, ????????????, [Forms]![Main].[Combo35])
I need the ???????? to pull everything regardless of the data in that field
 
G

Guest

Forget the IIf. Use this as the criteria:

Like [Forms]![Main]![Combo35] & "*"

It's possible that the above could cause problems. For example if an option
is "A", the statement would bring in all data beginning with A.
 
F

fredg

Im trying to query a table with one of the criteria being from a Combo box in
a form. There are 2 options in the field, but if the user leaves it blank, I
want to pull both options. Right now, I have
Iif([Forms]![Main].[Combo35] Is Null, ????????????, [Forms]![Main].[Combo35])
I need the ???????? to pull everything regardless of the data in that field

Forms!Main!Combo35 OR forms!Main!Combo35 is null
 

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