Conditional formatting...

  Macnova 13:22 03 Feb 05
Locked

Can anybody help?

I'm trying to apply conditional formatting to a report control (Difference) which holds values ranging from 100 to -100. I want to format the control as so:

=> 0 = green
0 and > -10 = orange
= -10 = red

I have used Conditional formatting in Access 2000 to do this, but it will only respond to the first negative condition and turns all negative numbers orange.

To overcome this, I have turned to VBA and have written some code in the OnFormat event of the controls section

Dim Difference As Single
If Me!Difference >= 0 Then
Me!Difference.ForeColor =vbGreen
ElseIf Me!Difference 0 And Me!Difference >= -10 Then
Me!Difference.ForeColor =vbOrange
EsleIf Me!Difference -10 Then
Me!Difference.ForeColor =vbRed
End If

This brings up the sames results, i.e. all negative numbers are displayed as orange. How do I overcome this and make access recognise more than one conditional format on negative values?

Cheers

  Macnova 14:11 03 Feb 05

i have posted this again as i made mistakes on it . please see conditional formatting negative numbers. cheers .

This thread is now locked and can not be replied to.

Nintendo Switch review: Hands-on with the intuitive modular console and its disappointing games…

1995-2015: How technology has changed the world in 20 years

This abstract video touches on division in our technologic world

Best alternatives to iTunes for Mac | Best music players for macOS: Free your music from the…