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!

changing text colors in a report 1

Status
Not open for further replies.

fredk

Technical User
Jul 26, 2001
708
US
Is there a way to have negative numbers red and positive numbers black in a report? I have done this on forms but not sure how to achieve it in a report???

Thanks in advance for the help!!!!

[pacman]

Fred
 
In the On Format event of your report's detail section put code like this:
Code:
If Me.txtYourField < 0 then
   Me.txtYourField.ForeColor = vbRed
Else
   Me.txtYourField.ForeColor = vbBlack
End If
[code]
 
Perfect, thank you very much - I was not sure what event to use- One other thing - To apply that to all fields in the detail section.... I am thinking I could use a variable but I am not sure how to run through all the text boxes ?? Thanks again for your help!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top