G
Guest
Hi -
I am using the query wizard and I have a field (e.g. named Region) that I
want to show only if there is something selected in my combo box (i.e. only
if a field type (e.g. Asia, North America etc.) has been selected in my combo
box. Thus, in my query wizard, under criteria, I have
[forms]![frm_Name]![cmb_Box_Region].
So what I am trying to do is to write an 'If' statment to only return fields
if a region was selected in the combo box. Else if no region was selected, I
DO NOT show this field AT ALL.
I used the following IIf statement but it returns no data if the combo box
is blank:
Criteria: IIf([forms]![frm_Name]![cmb_Box] <>"", [forms]![frm_Name]![cmb_Box])
Also, I tried using the 'Like "*"' function and the 'Is Null' function and
they do not seem to work.
Lastly, I know that if I duplicate this SQL statement in VBA instead of the
wizard, I could probably use a bunch of IF statements to alter my SQL. But
since I am using a CrossTab Query, it makes it a little harder for me to
duplicate this SQL statement in VBA.
Does my question make sense?
Please help. Thanks
I am using the query wizard and I have a field (e.g. named Region) that I
want to show only if there is something selected in my combo box (i.e. only
if a field type (e.g. Asia, North America etc.) has been selected in my combo
box. Thus, in my query wizard, under criteria, I have
[forms]![frm_Name]![cmb_Box_Region].
So what I am trying to do is to write an 'If' statment to only return fields
if a region was selected in the combo box. Else if no region was selected, I
DO NOT show this field AT ALL.
I used the following IIf statement but it returns no data if the combo box
is blank:
Criteria: IIf([forms]![frm_Name]![cmb_Box] <>"", [forms]![frm_Name]![cmb_Box])
Also, I tried using the 'Like "*"' function and the 'Is Null' function and
they do not seem to work.
Lastly, I know that if I duplicate this SQL statement in VBA instead of the
wizard, I could probably use a bunch of IF statements to alter my SQL. But
since I am using a CrossTab Query, it makes it a little harder for me to
duplicate this SQL statement in VBA.
Does my question make sense?
Please help. Thanks