Change colour

peterbowles

Registered User.
Local time
Today, 16:57
Joined
Oct 11, 2002
Messages
163
Hi
Can you have a combo box on a form, which is populated with say 5 different colour, Red, Blue, White, Grey, Green

In the after update event can the background colour of the form be cahnged to which ever colour is selected in the combobox

Thanks
 
Yes, it's possible:

once the value is in the combobox use a SELECT CASE statement to change the BackColor property of your form's detail

Code:
Select Case cboYourCombo
   Case = "Red"
      Me.Detail.BackColor = RGB(255, 0, 0)
   Case = "White"
      Me.Detail.BackColor = RGB(255, 255, 255)
   Case = "Blue"
      Me.Detail.BackColor= RGB(0, 0, 255)
   etc. etc.
End Select
 
You could of course just use vbRed, vbBlack etc
 
What about vbReddishOrange, Rich? Is that a VB constant? :p
 

Users who are viewing this thread

Back
Top Bottom