Formatting Issues - Combo Box

DJ100

Registered User.
Local time
Today, 08:22
Joined
Jul 4, 2002
Messages
34
Hi,

I have a combo box in a form and dependent upon what is selected I want to display different formatting.

Ideally I would like to display some entries in red.

If I could change the colour of an individual record in the table my problem would be solved - but I can't find a way of doing this. :mad:

Any help would be gratefully received
 
Do you want to change the formatting of the combo or other parts of the form.
If it is the combo, you will need to screen for that certain info using vba code in the After_Update of the combo and Form_Current events.
Eg
Form_Current()
if me.ComboName = YourValue then
me.ComboName.backcolor = 255 'Change background to red
else me.ComboName.backcolor = 16777215 'Change background to white
end if

sub ComboName_After_Update()
Form_Current
end sub

HTH
 
Thanks for that . .. .

I'll give it a go - my biggest problem is going to be selecting the value to make the change.

The combo contains a list of Over 500 vehicles - I want to make changes for all entries containing Mercedes, BMW and other marques . . .

I'll crack on with your suggestion so far ..

Ta
 
You can use the select....case method to process a number of variables. Another (more complex) way is to store the colour with the actual record and then format the combobox according to that - I've included a demo on how you can do this (It may take a bit of picking apart to see how it works though)
 

Attachments

Users who are viewing this thread

Back
Top Bottom