I have a combo box (forms!report!SearchS) with 3 choices.
0 = All (Created by a Union Query in the combo box)
1 = Open
2 = Closed
I have the IIF statement in the criteria of the query that looks at the combo box. The problem arises is the values in the database only includes 1 or 2. I want to use the zero in the combo box to include both statuses. I think I need to use a IIF statemnt as part of the crietia, however I have not been able to get the "all" i.e. "0" selection to work. Selecting 1 or 2 int eh combo box returns correct results. Here is the IIF statment in the criteria:
The field is report.status from report.
iif(Forms!Report!SearchS = 0, Null, Forms!Report!SearchS)
also tried
iif(Forms!Report!SearchS = 0, "", Forms!Report!SearchS)
also tried
iif(Forms!Report!SearchS = 0, 1 and 2 , Forms!Report!SearchS)
When the value is zero the query does nothing and return no results.
Bascially I'm looking for the creteria to be null so it will pass all values (1 and 2) instead of a 1 or a 2.
Your help is greatly appreciated. Let me know if you have any questions.
0 = All (Created by a Union Query in the combo box)
1 = Open
2 = Closed
I have the IIF statement in the criteria of the query that looks at the combo box. The problem arises is the values in the database only includes 1 or 2. I want to use the zero in the combo box to include both statuses. I think I need to use a IIF statemnt as part of the crietia, however I have not been able to get the "all" i.e. "0" selection to work. Selecting 1 or 2 int eh combo box returns correct results. Here is the IIF statment in the criteria:
The field is report.status from report.
iif(Forms!Report!SearchS = 0, Null, Forms!Report!SearchS)
also tried
iif(Forms!Report!SearchS = 0, "", Forms!Report!SearchS)
also tried
iif(Forms!Report!SearchS = 0, 1 and 2 , Forms!Report!SearchS)
When the value is zero the query does nothing and return no results.
Bascially I'm looking for the creteria to be null so it will pass all values (1 and 2) instead of a 1 or a 2.
Your help is greatly appreciated. Let me know if you have any questions.