valterduarte
Technical User
Hello!
I have a problem with an IIF Statement in a query, that I would like to ask for help solving it:
I have something like this:
Table A:
Field AX:
A1
A2
A3
Table B:
Field BX:
B1
B2
B3
I have a form-based query. I have a list box in the FORMX with option1 and option2. One of the criterias in this query is supposed to return all records similar to Field AX when option1 is selected and all records similar do Field BX when option2 is selected.
The code in this criteria looks like this:
IIF(([Forms]![FORMX]![List Box]=option1);
In (SELECT [Field AX] FROM [Table A]);
In (SELECT [Field BX] FROM [Table B]))
What am I doing wrong?
Thank you!
I have a problem with an IIF Statement in a query, that I would like to ask for help solving it:
I have something like this:
Table A:
Field AX:
A1
A2
A3
Table B:
Field BX:
B1
B2
B3
I have a form-based query. I have a list box in the FORMX with option1 and option2. One of the criterias in this query is supposed to return all records similar to Field AX when option1 is selected and all records similar do Field BX when option2 is selected.
The code in this criteria looks like this:
IIF(([Forms]![FORMX]![List Box]=option1);
In (SELECT [Field AX] FROM [Table A]);
In (SELECT [Field BX] FROM [Table B]))
What am I doing wrong?
Thank you!