Conditional formating

Accessme2

Registered User.
Local time
Today, 16:53
Joined
May 12, 2004
Messages
64
Hi everyone,
I have a field that would have a value of 1,2,3,4 I want to have the back color for each number like 1=red, 2=green, 3=blue, 4= yellow.. I try to do it with the format\conditional formatting and well i can only do 3 conditions.
How can I do this...

I am using access 2000,Windows XP pro

thanks
AMD2800 :D
 
you cannot, atleast if it is a tabular form... (see multiple records on the screen at the same time)

Otherwize if it is not in tabular form you can use the "On Current" event.
 
This requires code but it can be done. I'm assuming that this is a continous report. It's been a bit since I've done this and I would need to grab the specifics of the code from a currently inaccessible database.

Here's an example of some code I used to make this happen.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.ID < 5 Then
Me.Detail.BackColor = vbRed
Else
Me.Detail.BackColor = vbYellow
End If
End Sub
 
It is a continuous form, with only two fields Value1 and Value2. I need Value2 to change colors depend of the value I try a Select case but it only did the first value and keep the color on all record regardless of the value. the conditional formatt work well but like i said only with 3 different values.. I need 4 and maybe more later on.
 
It is a continuous form, with only two fields Value1 and Value2. I need Value2 to change colors depend of the value I try a Select case but it only did the first value and keep the color on all record regardless of the value. the conditional formatt work well but like i said only with 3 different values.. I need 4 and maybe more later on.

With a continous form, what you are experiencing is what it's suppose to do. Since, in reality, there are only two controls on the form, the formatting you want to do via code will depend on the record you have selected.
 
you cannot, atleast if it is a tabular form... (see multiple records on the screen at the same time)

Otherwize if it is not in tabular form you can use the "On Current" event.

Like I said, if tabular / coninues form you cannot ...
 
It’s a bit of a fiddly but it can be done.

A97 demo attached but it also works in later versions.

Regards,
Chris.
 

Attachments

Users who are viewing this thread

Back
Top Bottom