Conditional Formatting > 3 conditions in a continuous form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a continuous form which displays project information, including project status. This status can be up to 7 color codes: red, yellow, green, blue, purple, grey, black. The form field displays the word, and should be highlighted with the appropriate color

I have read all the threads on this, and got Lebans example to work. However, it only works when the focus is on the record. When I run the function (below) field of all the records is colored by the last record processed. Can anyone assist me

Private Function SetStatusColor(ctl As Control) As Boolea
ctl.ForeColor = plWhit
Select Case ctl.Valu
Case "Green
ctl.BackColor = plGree
ctl.ForeColor = plBlac
Case "Red
ctl.BackColor = plRe
Case "Yellow
ctl.BackColor = plYello
ctl.ForeColor = plBlac
Case "Purple
ctl.BackColor = plPurpl
Case "Blue
ctl.BackColor = plBlu
Case Els
ctl.BackColor = plWhit
End Selec
End Functio
 
Using CF, you can only have a total of 3 individual colors...period.
:-(
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Marguerite Guthridge said:
I have a continuous form which displays project information, including
project status. This status can be up to 7 color codes: red, yellow,
green, blue, purple, grey, black. The form field displays the word,
and should be highlighted with the appropriate color.
I have read all the threads on this, and got Lebans example to work.
However, it only works when the focus is on the record. When I run the
function (below) field of all the records is colored by the last record
processed. Can anyone assist me?
 
None that I know of.
:-(
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Marguerite Guthridge said:
Thanks, Stephen, for confirming what I thought. Is there a different
way that would work?
 
Back
Top