Depends on whether the toggle button is an separate control
or if it's in a option group frame.
By itself:
Private Sub Toggle1_Click()
If Toggle1 = True Then
Toggle1.ForeColor = vbGreen
Else
Toggle1.ForeColor = vbRed
End If
End Sub
In a frame:
Private Sub Frame2_AfterUpdate()
Dim ctl As Control
For Each ctl In Frame2.Controls
If ctl.ControlType = acToggleButton Then
If ctl.OptionValue = Frame2 Then
ctl.ForeColor = vbGreen
Else
ctl.ForeColor = vbRed
End If
End If
Next ctl
End Sub
Note that you can not change the background color of a
button, so ForeColor is your only choice.
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.