I have a form with three buttons relating to three yes/no variables that are not mutually exclusive in a subform. By default Access sets up the relationship using "and" so if I select two of the three buttons it shows me all the observations that have "yes" for both, but I want the buttons to have an "or" relationship so that if I select two buttons I want all the observations where it says yes to either of the two checked variables.
I'm trying to write a query that will do this, but Access doesn't support SQL case function and I can't get it to work with the IIF statement.
I want to code something along the lines of:
select var1,var2,var3
from table
where iif(form!form1!var1=yes and form!form1!var2=no and form!form1!var3=yes,table.var1=yes or table.var3=yes and table.var2=no,...)
It seems you can only use iif in certain places. Any ideas how to do this?
And (table.var1=yes or table.var3=yes). Make another stab at it and then post the whole statement. - Fionnuala