S
SoggyCashew
Hello, I have a row (1-31) of text boxes in a continious form starting with
Text1, Text2, Text3 and so on. now I need to change the color of the Text box
to whatever attendance code is in it. Lets say it has a V in the box then it
would change the Text box to green or if it had EA in it then I want the
color to be yellow and so on. I would use conditional formating but I have
several options. Something like below is what im looking for. If I use
something like Me.Controls ("Text") would that work or is this a loosing
battle?
Select Case
Case "V"
Bclr = 438366: Fclr = 0
Case "PD"
Bclr = 16711680: Fclr = 16777215
Case "UH"
Bclr = 16633344: Fclr = 0
Case "ET"
Bclr = 8421504: Fclr = 16777215
Case "EA"
Bclr = 65535: Fclr = 0
Case "WH"
Bclr = 16777164: Fclr = 0
Case "UA"
Bclr = 255: Fclr = 16777215
Case "UT"
Bclr = 16711935: Fclr = 16777215
Case "ELE"
Bclr = 65535: Fclr = 0
Case "PC"
Bclr = 26367: Fclr = 16777215
Case "DL"
Bclr = 16776960: Fclr = 0
Case "ML"
Bclr = 128: Fclr = 16777215
Case "FL"
Bclr = 65280: Fclr = 0
Case "PL"
Bclr = 10092543: Fclr = 0
Case "JD"
Bclr = 52479: Fclr = 0
Case "FL"
Bclr = 13408767: Fclr = 0
End Select
Text1, Text2, Text3 and so on. now I need to change the color of the Text box
to whatever attendance code is in it. Lets say it has a V in the box then it
would change the Text box to green or if it had EA in it then I want the
color to be yellow and so on. I would use conditional formating but I have
several options. Something like below is what im looking for. If I use
something like Me.Controls ("Text") would that work or is this a loosing
battle?
Select Case
Case "V"
Bclr = 438366: Fclr = 0
Case "PD"
Bclr = 16711680: Fclr = 16777215
Case "UH"
Bclr = 16633344: Fclr = 0
Case "ET"
Bclr = 8421504: Fclr = 16777215
Case "EA"
Bclr = 65535: Fclr = 0
Case "WH"
Bclr = 16777164: Fclr = 0
Case "UA"
Bclr = 255: Fclr = 16777215
Case "UT"
Bclr = 16711935: Fclr = 16777215
Case "ELE"
Bclr = 65535: Fclr = 0
Case "PC"
Bclr = 26367: Fclr = 16777215
Case "DL"
Bclr = 16776960: Fclr = 0
Case "ML"
Bclr = 128: Fclr = 16777215
Case "FL"
Bclr = 65280: Fclr = 0
Case "PL"
Bclr = 10092543: Fclr = 0
Case "JD"
Bclr = 52479: Fclr = 0
Case "FL"
Bclr = 13408767: Fclr = 0
End Select