Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

An If Then statement in an Access Query

Status
Not open for further replies.

dunner44

MIS
Jul 27, 2004
32
US
My criteria in my query reads...
[Forms]![frm_reports]![Text72]

Text72 is a combobox on a form, and within the list of options in the combobox is a "Veiw All" option. How would I rewrite my criteria to say, " If Text72 = 'View All' Then the criteria field should be blank to pull back all options, else criteria = Text72"

Any suggestions?

TIA.
 
Hi,
code]
IIF(Text72="View All","",Text72)
[/code]


Skip,

[red]Be advised:[/red] [glasses]
Alcohol and Calculus do not mix!
If you drink, don't derive! [tongue]
 
Code:
IIF(Text72="View All","",Text72)

Skip,

[red]Be advised:[/red] [glasses]
Alcohol and Calculus do not mix!
If you drink, don't derive! [tongue]
 
I tried that, and it pulled back no records.
Here is what I have as my code...

IIf([Forms]![frm_reports]![Text72]="View All","",[Forms]![frm_reports]![Text72])

Am I missing something?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top