Change Combo Box Row Colour

daved2424

Registered User.
Local time
Today, 19:53
Joined
Jun 28, 2001
Messages
20
Is it possible to assign a different colour to each row of a combo box? I am pressuming that I have to use VBA, but my VB skills are incredibly rusty at best and I am not much better at Access. Is anyone able to offer me any pointers?

Many thanks for any help in advance.
 
Is it possible to assign a different colour to each row of a combo box? I am pressuming that I have to use VBA, but my VB skills are incredibly rusty at best and I am not much better at Access. Is anyone able to offer me any pointers?

Many thanks for any help in advance.

No, sorry - not something that can be done with the Access combo box. You would need a third-party ActiveX control (of which I'm not sure if there are any) that does that.
 
Hmm. Ok would possible to get a rectangle to change colour depending on what was selected in the combo box and if so what would be the best way to update that?
 
or even change the colour of the entire combo box based on what is selected
 
You can put something in the change event to change the format - not sure what you are trying to do - but this would certainly highlight certain choices
Private Sub cboClient_Change()
Debug.Print Me.cboClient.Text
If Me.cboClient.Text = "Jones" Then
Me.cboClient.BackColor = vbRed
Me.cboClient.ForeColor = vbWhite
Else
Me.cboClient.BackColor = vbWhite
Me.cboClient.ForeColor = vbBlack
End If
End Sub
 
and
the Change event will fire on every key-stroke (typing in the cbobox).
the After Update event will fire after something is selected.
 
Thanks for that. That's great and works perfectly. Although there is one thing I overlooked. The combo box I am changing is part of a continuous form, however different forms might have different values and are therefore required to be different colours. Is there anyway to change them independently or am I just stuck with it?
 
Have a look at my conditional formatting demo for continious forms. That may help.

Bob. There is a site that has ocx's here is a screen shot of a multi coloured combobox that can even contain pictures.
 

Attachments

Users who are viewing this thread

Back
Top Bottom