Change Toggle Button Caption

L

laser02910

I'm not very good with VBA yet and I'm trying to get my toggle button to
change from "No" in the non-depressed state to "Yes" in the depressed state
and back again. I've tried searching and found a post by Allen Brown
(11/24/2004) but I can only get the button to change once. Any help would
greatly be appreciated.
 
L

Linda Burnside

Try something like this:

Option Compare Database
Public clicked As Boolean

Private Sub Command0_Click()
If clicked = True Then
Me.Command0.Caption = "No"
clicked = False
Else
Me.Command0.Caption = "Yes"
clicked = True
End If


End Sub
 
L

laser02910

Thank you so much Linda! I had not expected to get a reply that fast. This
worked perfect.
 
Top