Null Value messing up form criteria in query (1 Viewer)

gblack

Registered User.
Local time
Today, 03:38
Joined
Sep 18, 2002
Messages
632
I have a dropdown combo box in a form. On the dropdown listing, you can choose any item or “all” the items. If you choose “ALL”, the query that the form is bound to post the field name, itself, to the criteria for the field. I don't know a better way to word that, but its hard for me to follow that last sentance and I wrote it... Here's an example of what I am trying to say: I am using a Table of Allowance (TOA) field, so my field name is: [TOA]. The criteria section with the query looks kind of like this:

Code:
 IIF([FORMS]![FormName]![cmbxTOA] = “ALL”, [TOA], [FORMS]![FormName]![cmbxTOA])

It’s not exactly that, but you get the picture.

So… this works fine if [TOA] is not null… but if TOA is null and the user chooses “ALL” from the combo box, they should be able to see all the values, but the null values are not appearing… They don’t appear either when the criteria value is set to Like “*”… but when I add OR IS NULL in the [TOA] criteria the null valued records appear.

So is there some way that I can add: OR IS NULL to the IIF([FORMS]![FormName]![cmbxTOA] …?

Is there an easier workaround that I am not seeing?
 
Last edited:

Users who are viewing this thread

Top Bottom