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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIF statement in criteria line

Status
Not open for further replies.

Scoob55k

Technical User
Nov 16, 2005
62
US
I have a query that I want to use an IIF statement return either specific data or all records depending on a text box value on a form.

Basically the statemet reads as such:

=IIf([Forms]![frm Reports by Type]![TaskType]="All",Null,[Forms]![frm Reports by Type]![TaskType])

It works fine as with a certain Task Type selected, but left as "ALL" it returns nothing. I've tried "" and 0 before I did the Null, but ended up the same result. Thanks!
 
Code:
=[Forms]![frm Reports by Type]![TaskType] OR 
 [Forms]![frm Reports by Type]![TaskType]="All"
 
Sweet! For some reason I do not think I would have ever figured that out. Way too simple.

Thanks!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top