D
Daffy
I have a query which contains an IIF statement that checks for a value in a
combo box in a form. It checks to see if it is null. If it is, then the
query must display ALL its values, and if it isn't, it must display only
those values from the combo box.
I have no problem displaying the values that match the values in the combo
box. My problem is as follows, when I tell it to display ALL its values, it
only choses to display rows that ARE NOT NULL, those omiting the NULL rows.
Here is my IIF statement:
IIf([Forms]![frmSearch]![ComboCSLength] Is Null,[Length
(m)],[Forms]![frmSearch]![ComboCSLength])
Now, if I was to get rid of the IIF statement all together and replace it
with:
[Length (m)] Or Is Null
Is Null
my query displays all the values or the Null values respectively.
HOWEVER if I place any of tje above in my IIF statement like so:
IIf([Forms]![frmSearch]![ComboCSLength] Is Null,([Length (m)] Or Is
Null),[Forms]![frmSearch]![ComboCSLength])
IIf([Forms]![frmSearch]![ComboCSLength] Is Null,Is
Null,[Forms]![frmSearch]![ComboCSLength])
my query displays NO VALUES.
I've tried so many differen't things but I just can't get it to work.
What does work, is if I put Is Null in one of the Or fields, however, this
creates the problem of dipslaying Null values along with values from my combo
box when the IIF statement is FALSE.
PLEASE HELP ME I'M OUT OF IDEAS and DO NOT WANT TO HAVE NONE NULL VALUES.
Daffy
combo box in a form. It checks to see if it is null. If it is, then the
query must display ALL its values, and if it isn't, it must display only
those values from the combo box.
I have no problem displaying the values that match the values in the combo
box. My problem is as follows, when I tell it to display ALL its values, it
only choses to display rows that ARE NOT NULL, those omiting the NULL rows.
Here is my IIF statement:
IIf([Forms]![frmSearch]![ComboCSLength] Is Null,[Length
(m)],[Forms]![frmSearch]![ComboCSLength])
Now, if I was to get rid of the IIF statement all together and replace it
with:
[Length (m)] Or Is Null
Is Null
my query displays all the values or the Null values respectively.
HOWEVER if I place any of tje above in my IIF statement like so:
IIf([Forms]![frmSearch]![ComboCSLength] Is Null,([Length (m)] Or Is
Null),[Forms]![frmSearch]![ComboCSLength])
IIf([Forms]![frmSearch]![ComboCSLength] Is Null,Is
Null,[Forms]![frmSearch]![ComboCSLength])
my query displays NO VALUES.
I've tried so many differen't things but I just can't get it to work.
What does work, is if I put Is Null in one of the Or fields, however, this
creates the problem of dipslaying Null values along with values from my combo
box when the IIF statement is FALSE.
PLEASE HELP ME I'M OUT OF IDEAS and DO NOT WANT TO HAVE NONE NULL VALUES.
Daffy