How To Make Colored Box Controlled by buttons

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'd like to create a control on a form that's governed by an option group.
Depending on which toggle is checked, the control would change to one of 4
colors. I'm sure this can be done but don't know how to start.
 
let's assume that the option buttons in your option group have the values of
1, 2, 3, 4. the value of an option group control is equal to the OptionValue
property of the selected option button (the "toggle"). so if you click on
OptionButton3, the option group control's value = 3. using the 1, 2, 3, 4
example, you can write code based on the value of the option group control,
as

Select Case Me!OptionGroupName
Case 1
Me!OtherControl.BackColor = 198 ' deep red
Case 2
Me!OtherControl.BackColor = 255 ' bright red
Case 3
' another color
Case 4
' another color
Case Else
' a default color
End Select

hth
 

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

Back
Top