alright, I have a bit of a problem. I've been writting a few queries of mine through VBA b/c of a wealth of criteria, however for the sake of clarity, as well as the users requesting the quesries themselves, I want to use expressions in the criteria of the query.
Now, here's what I'm trying to do.
on my form that opens the query (which really is the source for several reports) I have about 9 different criteria, each of them are enabled by a check box. In other words, if the checkbox is checked the criteria box is enabled. Now each of those checkboxes has either a combo box filled from a query that relates to a field in the query, or there are option buttons in a frame for yes/no field types.
And finally, here's my problem. In the criteria section of a particular field, I have this iif statement for a yes/no:
IIf([forms]![viewreports]![chkaddress],IIf([forms]![viewreports]![frameaddress]=1,"yes"))
where frameaddress is the option button in the frame
and this for a combo box:
IIf([forms]![viewreports]![chkaddresstype],[[forms]![viewreports]![addresstype],)
SO, now when the check box is selected, I have no problem, however, if it's not, I get nothing showing up(which there should be something showing up.
either that or I sometimes get an error of it's too complex.
Thanks anyone for your response.
-Bauer
Now, here's what I'm trying to do.
on my form that opens the query (which really is the source for several reports) I have about 9 different criteria, each of them are enabled by a check box. In other words, if the checkbox is checked the criteria box is enabled. Now each of those checkboxes has either a combo box filled from a query that relates to a field in the query, or there are option buttons in a frame for yes/no field types.
And finally, here's my problem. In the criteria section of a particular field, I have this iif statement for a yes/no:
IIf([forms]![viewreports]![chkaddress],IIf([forms]![viewreports]![frameaddress]=1,"yes"))
where frameaddress is the option button in the frame
and this for a combo box:
IIf([forms]![viewreports]![chkaddresstype],[[forms]![viewreports]![addresstype],)
SO, now when the check box is selected, I have no problem, however, if it's not, I get nothing showing up(which there should be something showing up.
either that or I sometimes get an error of it's too complex.
Thanks anyone for your response.
-Bauer