Toggle button caption (1 Viewer)

zyxwvu44

Registered User.
Local time
Today, 00:23
Joined
Jul 19, 2007
Messages
36
Hello all,

I have a form where a toggle button hides certain listboxes and buttons when you click on it, and brings them back when you click on it again. Is there any way to make the caption of the toggle button change when you click it, and then go back when you click it again? I've researched online for hours on this and havn't found a single clue. Thanks for your help!
 
Code:
Private Sub Toggle35_Click()

If Me.Toggle35.Caption = "Hello" Then
   Me.Toggle35.Caption = "Goodby"
Else
   Me.Toggle35.Caption = "Hello"
End If

End Sub
 
Instead of using the caption y not make a label and turn it to visible when clicked one time and not when its clicked 2 times?

EDIT: Try RG's First. i like that idea better.
 
i based this off of the first reply and it worked, thank you! :D


If (Me.Toggle54) Then
Me![Toggle54].Caption = "A"
Else
Me![Toggle54].Caption = "B"
End If
 

Users who are viewing this thread

Back
Top Bottom