Want to use an immediate if in identifying the criteria for a field in a query.
There's a check box called, for example, Box1, on on an open form called FOrm1. From this form we click an option to open form2 with an underlying query called Query1.
The criteria for a field called Field1 says "If Box1 is not checked then filter the form to EXCLUDE records with "North" in Field1. If it is checked then select records with "South" in the field.
I made the criteria iif this way: iif(Forms![form1].[box1]=false,Not "north","South"). IF the box is checked, I get "South" records. If it is not checked I get no records even though there are records with "North".
Something seems not to work if I use the Not (or if I use <>). If I remove the not, and have "North","South" then I get either just North records or just South records.
If I remove the IIF and use just Not "North", I get all "Not North" records.
Any ideas why embedding the Not would cause the criteria not to work?
There's a check box called, for example, Box1, on on an open form called FOrm1. From this form we click an option to open form2 with an underlying query called Query1.
The criteria for a field called Field1 says "If Box1 is not checked then filter the form to EXCLUDE records with "North" in Field1. If it is checked then select records with "South" in the field.
I made the criteria iif this way: iif(Forms![form1].[box1]=false,Not "north","South"). IF the box is checked, I get "South" records. If it is not checked I get no records even though there are records with "North".
Something seems not to work if I use the Not (or if I use <>). If I remove the not, and have "North","South" then I get either just North records or just South records.
If I remove the IIF and use just Not "North", I get all "Not North" records.
Any ideas why embedding the Not would cause the criteria not to work?