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

Dynamically set Font color for report

Status
Not open for further replies.

dbero

Technical User
Mar 31, 2005
109
US
Hello!

I am running a report that has a query record source. Can you please give me some tips on how to set the font to red when, for instance, Question 3 is 'Yes', and black whene the value is NO, etc. The challenge is that I am displaying a list of orders, so order 1 may have a value of Yes (sh/be Red), but order 2 has a value of No (sh/be Black). All orders are displayed on the report.

thank you,
 
Have a look at Conditional Formatting.
 
Assuming you used true false for convention for your yes/no field then try using...

if nameoffield then
nameoftextbox.forecolor = 255
else
nameoftextbox.forecolor = 0
end if

or an easier way of writing it

nameoftextbox.forecolor = IIf([nameoffield],255,0)



Ian Mayor (UK)
Program Error
Always make your words sweet and nice. Because you never know when you may have to eat them.
 
remou's suggestion is better.

Ian Mayor (UK)
Program Error
Always make your words sweet and nice. Because you never know when you may have to eat them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top