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!

REPORTS WITH RED NEGATIVE NUMBERS

Status
Not open for further replies.

gearhead03

Technical User
Mar 29, 2003
147
US
I have a report that I would like the positive numbers to be black and the negative numbers to be red. I have done this in a form before using if...then...else. However the field on the report doesn't give me the option to put code in events. the field I want the colors to change on is a calculated field. the calculations are done in the query for the report.

Mark A. Kale
 
Use conditional formatting on the field in question.

HTH,
Eric [smile]
 
I can only think of a vb solution.

Copy the following code into the module for the report :

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

if txt_name < 0
txt_name.forecolor = 255
else
txt_name.forecolor = 0
end if

end sub

I haven't tested it but it should do the job !
 
You can format the color for the text box.
In the Text Box properties, set the format to be:

[Black];[Red];[Black]

These correspond to positive; negative; zero values for the text box.
 
John,
Where should I enter that statement? I tried it in the format (which is currency) and also in the fore color block.

Mark A. Kale
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top