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!

IIF AND Operator - Does one exist?

Status
Not open for further replies.

sdimaggio

Technical User
Jan 23, 2002
138
US
How can I get two conditions to exist in an IIF statement which is on a report.

Example:

IIF([field1]="ABC" and [field2]="XYZ",[field4],[field5])


I want to check to see if field1=abc and field2=xyz and if both are true then the controlbox will equal field4 otherwise it will equal field5.

For various reasons I do not want to use a query.

How do I do this.

Thanks.

Steve
 
Hi, what you have written is correct. If you are placing the statement in a text box, ensure you place an equeals sign ( = ) sign in front of the statement:

=IIF([field1]="ABC" and [field2]="XYZ",[field4],[field5])

This assumes that fields 1,2,4,5, are text boxes on the report in question.
Hope that helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top