Solved: how do I write an expression for conditional formatting

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

109boW

Thread Starter
Joined
Oct 3, 2007
Messages
52
how do I write an expression ti conditionally format a report field, called Copy of New report.
In the field Dia @ last turn, If any of 30A,30B,30C,30D=<720 then highlight the value in red and if either of 40A,41D=<730 then highlight the value in red

Thanks
Ben:confused:
 

Attachments

Joined
Oct 20, 2004
Messages
7,837
Well, I just spent two hours scribbling code trying to make it work, but keep getting errors - looking forward to seeing this one!!! :p
 
Joined
Oct 20, 2004
Messages
7,837
LOL - well, what else am I going to do at 3 in the morning? Sleep?
I can get one condition or the other to work, just not both.
 

OBP

Joined
Mar 8, 2005
Messages
19,895
slurpee, can you post your copy please, I can't Unzip 109's?
 

OBP

Joined
Mar 8, 2005
Messages
19,895
slurpee, thanks, I am doing a background virus scan and that may be blocking it.
 

OBP

Joined
Mar 8, 2005
Messages
19,895
slurpee, thanks, I am doing a background virus scan and that may be blocking it.

No yours opens OK!
 

OBP

Joined
Mar 8, 2005
Messages
19,895
109, can you clarify for me, if any of the 30s are = to or less than 720, do you want to highlight just that one Value or all of the values in the 30s?
 

109boW

Thread Starter
Joined
Oct 3, 2007
Messages
52
I'm not sure how you've done it, but seems to be along the right lines. Is it possible to highlight the font rather than the field its self.
Just to complicate things, in the report Positions, if a position 30A,30B,30C,30D,40B,40C,40D,41A,41B,41C,31A,31B,31C,31D =<720 the font should be highlighted red AND if a position 40A,41D =<730 the font should be highlighted red.
Hope this clarifies
Thanks
Ben
 

OBP

Joined
Mar 8, 2005
Messages
19,895
It was done using VBA in the "On Format" event procedure of the "Details" section of the Report.
I will look at changing it to suit you requirements.
 
Joined
Oct 20, 2004
Messages
7,837
OBP, if you are busy, I see how to do it (and using ForeColor instead of BackColor)
 

OBP

Joined
Mar 8, 2005
Messages
19,895
slurpee, it actually simplifies the code change it to

Dim red As Long, yellow As Long, green As Long, black As Long, grey As Long
red = RGB(255, 0, 0)
yellow = RGB(255, 255, 0)
green = RGB(0, 255, 0)
black = RGB(0, 0, 0)
grey = RGB(180, 180, 180)
If Me.Text24 <= 720 Then
Me.Text24.ForeColor = red
Else
Me.Text24.ForeColor = black
End If

If Me.Unitset = "40A" And Me.Text24 <= 730 Then Me.Text24.ForeColor = red
If Me.Unitset = "41D" And Me.Text24 <= 730 Then Me.Text24.ForeColor = red
 

Attachments

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top