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!

Change forecolor based on value 1

Status
Not open for further replies.

threadgills

Technical User
May 29, 2003
34
0
0
US
I have a report based off of a query that has a field called [Pro_form](yes/no field). Based on the value of the field, I want to be able to change the color of the font within the report, i.e., if pro_form = -1, then the font is red, otherwise, it's black.

Any ideas?
Thanks
 
Change the field names to suit yours but it will give you an idea


If RenewalDate < Date Then
RenewalDate.ForeColor = 255
RenewalDate_Label.ForeColor = 255
Else
RenewalDate.ForeColor = -2147483640
RenewalDate_Label.ForeColor = -2147483640

End If

Hope this helps
Hymn
 
I tried something similar to this and it only gave me the YES values but this works!!! I must have had my RGB values wrong. (I did it as txt_proform.forecolor = RGB(255,0,0) and txt_proform.forecolor = RGB(0,0,0))

Thanks again and a star for you!
 
It was a pleasure
Thank you for the star

Hope this helps
Hymn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top