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

If-then statements in report

Status
Not open for further replies.

crmorgan

Technical User
Apr 11, 2009
6
US
I have a report and I only want the field to show up if the field <30. For example

IIF([field1]<30,[field2],"")

I keep getting #Error on my report. I don't know where I'm going wrong in the formula.

Thanks,
 
Use "Conditional Formatting" on that field for easier going.

[purple]If we knew what it was we were doing, it would not be called
research [blue]database development[/blue], would it? [tab]-- Albert Einstein[/purple]​
 
I'm not sure why you didn't copy the Control Source. If the Control Source is not just a field name you must begin the expression with an =. Also, I would return a Null rather than "".[tt][blue]
=IIf([field1]<30,[field2],Null)[/blue][/tt]
Also, make sure the name of the control is not the name of a field.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top