conditional formating

T

todd ockert

I am building a database to track our to-do list. Part of
the formatting, is, different people have to use different
color fonts for their replies. I have about 7 people
useing this list on a day to day basis. I wrote VB code
that if person 1 entered data, the font is blue. This is
supposed to be keyed from another text box when they put
their initials there. It is not working though.
Here is the code I wrote.
If textbox.who = "ATC" then
fontcolor = blue
end if
If textbox.who = "AMCS" then
fontcolor = lt blue
end if
If textbox.who = "CAGMO" then
fontcolor = red
end if

The color in the item textbox is remaining black.
Any ideas on this issue?

Thanks

Todd
 
F

Fredg

I suppose the 'NAME' of the textbox control is "Who".

Place this code in the form's Current event, as well as
in the [Who] AfterUpdate event.

If [Who] = "ATC" then
[Who].forecolor = vbBlue
ElseIf [who] = "AMCS" then
[Who].forecolor = 16764057 ' a light blue
ElseIf [Who] = "CAGMO" then
[Who].forecolor = vbRed
etc....
Else
[Who].forecolor = vbBlack ' default if not one of the above values.
end if
 
T

Todd Ockert

Fred

Thanks for the info. The code below changes the line as I
need. When I have more then one line of updates, the code
then changes all lines to the color. IE, If ATC has made
an update, it will change the color of the line that AMCS
has put in from Lt Blue to Blue. Then when CAGMO puts in
his updates, all lines above his update change to Red.
How can I keep that specific line that color?

Thanks

Todd
-----Original Message-----
I suppose the 'NAME' of the textbox control is "Who".

Place this code in the form's Current event, as well as
in the [Who] AfterUpdate event.

If [Who] = "ATC" then
[Who].forecolor = vbBlue
ElseIf [who] = "AMCS" then
[Who].forecolor = 16764057 ' a light blue
ElseIf [Who] = "CAGMO" then
[Who].forecolor = vbRed
etc....
Else
[Who].forecolor = vbBlack ' default if not one of the above values.
end if


--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


todd ockert said:
I am building a database to track our to-do list. Part of
the formatting, is, different people have to use different
color fonts for their replies. I have about 7 people
useing this list on a day to day basis. I wrote VB code
that if person 1 entered data, the font is blue. This is
supposed to be keyed from another text box when they put
their initials there. It is not working though.
Here is the code I wrote.
If textbox.who = "ATC" then
fontcolor = blue
end if
If textbox.who = "AMCS" then
fontcolor = lt blue
end if
If textbox.who = "CAGMO" then
fontcolor = red
end if

The color in the item textbox is remaining black.
Any ideas on this issue?

Thanks

Todd


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top