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

Label that is conditional on other field

Status
Not open for further replies.

Michael57

Technical User
Nov 15, 2005
131
CA
I would like to generate a specific title on a report that is dependent on a value of a field in the report. So if a value of 30 comes up I want the title to be "OPEN" and if the value is 60 I want the title to be "CLOSED".
 
You could use a textbox instead of a label for the 'title'.

Then just conditionally display what you want. (Set the control source to the equal sign and something to evaluate your data).

=IIF(FieldWithValue = 30,"Open","Closed")

Technically, that will display Open if 30 is in the field and Closed if anything else is.
 
While lameid's suggestion is often used for a variable 'title', you may strike problems when you have more than one record returned in the report: for which record do you want the field to be referenced?

If you reference a field this way, it will return the field's value for the first record.


Max Hugen
Australia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top