Change Toggle Button Caption

G

Guest

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
 
G

Guest

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

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

Similar Threads


Top