Colour coding

LaFred84

New member
Local time
Today, 08:01
Joined
Jun 1, 2006
Messages
9
hi,
I am having a problem with a report as it has values in it that if above zero I need them to become surrounded by the colour green and if below zero I need them surrounded by the colour red.

I also have a problem in that if the number is zero I need it to display "break even", but I am unsure if this is a similar problem

Would be grateful to anyone who might have a solution

Lauren
 
try putting something like the following in the after update event of your field:

Code:
If Me.YourFieldName > 0 Then
Me.YourFieldName.BackColor = vbGreen
ElseIf Me.YourFieldName < 0 Then
Me.YourFieldName.BackColor = vbRed
ElseIf
Me.YourFieldName = 0 Then
Me.YourFieldName = "break even"
End If
 
Thank you for responding

However it seems the problem has already been solved by another member of my department.

The solution was to right click on the field that needed to be coloured and then go to conditional formatting where you can set a greater than 0 to be green and then add another condition for less than 0 to be red. We are now working on how to display break even if the value is 0.
 
yes you can do it with the conditional formatting as well, however, i don't think you can work out the "break even" thing via cond. formatting.

You may try using something like the IIF function i.e,

IIF(field = 0, "Break Even", "Not Break Even")
 

Users who are viewing this thread

Back
Top Bottom