how do I make checkbox color change when the value changes?

L

Lynda

I am using a checkbox. I would like the color of the check box to change
when checked. Is that possible?
 
B

Bob Phillips

If the checkbox is a control toolbox checkbox, use

Private Sub CheckBox1_Click()
With Me.CheckBox1
If .Value Then
.BackColor = RGB(255, 0, 0)
Else
.BackColor = RGB(255, 255, 255)
End If
End With
End Sub


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 
L

Lynda

Thank you!

Bob Phillips said:
If the checkbox is a control toolbox checkbox, use

Private Sub CheckBox1_Click()
With Me.CheckBox1
If .Value Then
.BackColor = RGB(255, 0, 0)
Else
.BackColor = RGB(255, 255, 255)
End If
End With
End Sub


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 
Top