IIf statements in queries

rodmane

New Member
Joined
Jun 16, 2002
Messages
19
I am trying to write an IIf statement in the criteria section of a field, the statement is:

IIf([Forms]![FRM: Import FN1 Extract - Manager Specific]![Combo0]="All",?,[Forms]![FRM: Import FN1 Extract - Manager Specific]![Combo0]")

Basically it takes the value selected in the combo box of a form and filters that name from the query and creates a table. I want the IIf statement to select all records if the value selected in the combo box is "All" and to select specific records if any other value is selected in the combo box. Thank you for the help.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Actually I would use form filter for this but here is your corrected criteria.

IIf([Forms]![FRM: Import FN1 Extract - Manager Specific]![Combo0]="All","",[Forms]![FRM: Import FN1 Extract - Manager Specific]![Combo0])

I hope it helps.
Suat
 
Upvote 0
I actually tried the following and it worked: Like IIf([Forms]![FRM: Import FN1 Extract - Manager Specific]![Combo0]="All","*",[Forms]![FRM: Import FN1 Extract - Manager Specific]![Combo0]")

The problem with the middle term was that the IIf statement was not letting the criteria just be the text so I added the I statement. Thanks!!
 
Upvote 0

Forum statistics

Threads
1,221,507
Messages
6,160,219
Members
451,631
Latest member
coffiajoseph

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top