Changing Text Colour in Report

Brad

Registered User.
Local time
Today, 21:41
Joined
Jun 29, 2005
Messages
11
I have a report and in the report I add two cells togeather. I want to make the result chnage to red if negative and stay black if positive, any ideas on how I do this ?

Cheers,
 
Hi Brad
While in your report design, click the field in question and on your menu click Format -> Conditional Formatting -> the rest should be easy.
Andrew :)
 
Hi Andrew,
You would think so but ... this is access 97 and there is no conditional format option in teh format menu, any other ideas ?
 
Ah yes - that piece of information might have been useful a few days ago ... ;)

Anyway, in your report design, select the field in question, and try something like this for the format :

$#,##0.00 ; [Red]-$#,##0.00

Or
0.00 ; [Red]-0.00
if you don't want the $ sign

Or
0 ; [Red] -0
if you don't want decimals, or any other combination of symbols and decimals.

Please note I haven't tested these given I have got A97 on this PC.

HTH, Andrew
 
This code come condition also works in form view in stead of useing currency you can use the following: Format: £#,##0.00 ; [Red]-£#,##0.00, thank you to others for sharing there knoledge :D

Alastair
 
in a code in Detail write this code.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If name < 0 Then
name.ForeColor = 255
Else
name.ForeColor = 0
End If
End Sub

name is the name of Your Text Box in report
255 is for red colour, 0 is for black

I hope it will do it
 
I have A97 and have just done it the VBA way...
This is a cool trick..I did notice that when you use the 0.00 ; [Red]-0.00 or any variation of this method, it off sets the alignment on the negitive values which is real strange.
Not a big deal but can limit the use in some reports/forms.
 
Cheers that worked a treat.. Yeah I forget about version info .. will make sure I include it next time .

Thanks heaps for your help, it is often the simpl things that make all the difference.
 
DanG said:
I have A97 and have just done it the VBA way...
This is a cool trick..I did notice that when you use the 0.00 ; [Red]-0.00 or any variation of this method, it off sets the alignment on the negitive values which is real strange.
Not a big deal but can limit the use in some reports/forms.
It doesn't on mine, at least not with currency values
 

Users who are viewing this thread

Back
Top Bottom