Colour Coding Combo Box

  • Thread starter Katherine Smith
  • Start date
K

Katherine Smith

I have a database of projects that I want to add priorities to. I have
included a combo box with options of high, medium and low. Is there any way
that I can change the colour of the writing or the colour of the background
so I have a sort of traffic lights system in order to grab people's attention
more easily. I would like to have one colour for each level of priority but
can only seem to change the background or font coulour for all of the words
together.
 
S

Stockwell43

Hi Katherine,

There are probably several ways to do this better but you can try the
following in the OnClick or AfterUpdate event of the CBO and also do not
leave the " " around you CBO name:

If Me."yourCBOname" = "High" Then
Me."yourCBOname".Backcolor= "255"

ElseIf Me."yourCBOname" = "Med"" Then
Me."yourCBOname".BackColor = "32768"

ElseIf Me."yourCBOname" = "Low"" Then
Me."yourCBOname".BackColor = "65535"

Else
End If
 
T

Tom

Is it a continuous form or does it only display a single record?

If its a continuous form you will need to use conditional formatting.
If displaying a single record you can use something like Stockwell43
suggested, just don't forget to update the colors as you move from
record to record (use the On Current event).

Tom

***This is for A2003 and prior - A2007 may be different - I have a
vague recollection that A2007 made some changes in conditional
formatting.
 

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