Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coloured Combo Box? 1

Status
Not open for further replies.

Cero21

Programmer
Sep 30, 2005
50
CA
Hi I have a table field that uses a lookup combo box. The values are: "green", "yellow" and "red". Is there any way I could make the background or names actually appear those colours as well? Thanks.
 
If you set up two columns:
"Red";255;"Yellow";65535;"Green";65280
You can say:
Private Sub cboColour_AfterUpdate()
Me.cboColour.BackColor = Me.cboColour.Column(1)
End Sub

Yellow as a fore colour is quite difficult to see. Changing the back colour makes selecting a new colour a little confusing.
 
It's true. It's a little confusing looking but it works I suppose :) Thanks for your help.
 
I guess I should have said that I would be inclined to put an empty unbound textbox beside the combo and let that change colour, same idea except:
Me.TextBoxName.BackColor = Me.cboColour.Column(1)
 
I've decided to go with your first idea as it makes the interface in this case cleaner.

Just one more thing now that I've been fooling around with it. Is it possible to have the colours show up right away? Right now the combo boxes are white until I change them, then they change to the colour I change it to.
 
Nevermind my last. I just added the code to the on enter event. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top