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

Setting a Control with an Iif Statement 1

Status
Not open for further replies.

Boots6

Technical User
Aug 12, 2011
91
0
0
US
This is on a report not a form, but hopefully someone can help me. I have a report that has fields: NAME, CLASSIFICATION, and WAGE. The report's Record Source is a Query called qryDISTRIBUTION. I want the WAGE field to be blank if the the CLASSIFICATION = "Superintendent"

I tried setting the WAGE control source to =Iif([CLASSIFICATION] = "Superintendent",Null,[WAGE]) but I'm getting an error because it's a circular reference. How can I better go about this?

Thanks!
 
Try being specific. [Reports]![ReportName]![Classification] and [Reports]![ReportName]![Wage]. You can also use [Screen].[ActiveReport] instead of [Reports]![ReportName] if you prefer.
 
I see a couple possible issues. First you used "NAME" as the name of a field. IMO, don't ever use reserved words to name anything particularly "NAME".

Next, is it possible the name of your text box is CLASSIFICATION or WAGE? This would create a circular reference.

Duane
Hook'D on Access
MS Access MVP
 
Thank you both for the reply! My text box was named WAGE and that was the problem - thanks so much!! I don't really have "NAME" as a field, I was just trying to be brief. I really appreaciate the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top