G
Guest
Hi,
I have the following expression in the criteria of [Security Type].[Security
Type ID] field in a query:
IIf([Forms]![frmLookup]![TypeSelect]=1,[Security Type].[Security Type
ID],IIf([Forms]![frmLookup]![TypeSelect]=2,3,<>3))
[TypeSelect] is a combo box on a form with the following 3 options:
1, All Securities
2, CV
3, ST
[Security Type ID] is from a table with numbers 1-50.
When I run the query with option 1 or 2 selected, it works fine. But it
returns nothing when option 3 is selected (the false piece of the 2nd IIf
statement). However, if I just use <>3 in the criteria by itself, the
correct records are returned. I can't figure out why it doesn't work while
inside the IIf statement. I don't get any errors, it just returns nothing.
Thanks in advance for the help!
-Jeff
I have the following expression in the criteria of [Security Type].[Security
Type ID] field in a query:
IIf([Forms]![frmLookup]![TypeSelect]=1,[Security Type].[Security Type
ID],IIf([Forms]![frmLookup]![TypeSelect]=2,3,<>3))
[TypeSelect] is a combo box on a form with the following 3 options:
1, All Securities
2, CV
3, ST
[Security Type ID] is from a table with numbers 1-50.
When I run the query with option 1 or 2 selected, it works fine. But it
returns nothing when option 3 is selected (the false piece of the 2nd IIf
statement). However, if I just use <>3 in the criteria by itself, the
correct records are returned. I can't figure out why it doesn't work while
inside the IIf statement. I don't get any errors, it just returns nothing.
Thanks in advance for the help!
-Jeff