Toggle Buttons

G

Guest

How can I get a toggle button to display a hidden subform when pressed, also
how can I get that same toggle button to hide the subform when i have
finished?

If anyone can help?
 
D

Damon Heron

In the declaration section of the form,
dim flag as integer

then, in the click event of the toggle button:

If flag = 0 Then
MsgBox "Clicked in" ' whatever code you want to add, to make a subform
visible, just change visible property to true
flag = 1
Else
MsgBox "clicked out" ' subform.visible= false
flag = 0
End If

HTH
Damon
 
D

Damon Heron

Ignore the last post. A more elegant solution is:

If ToggleName = true Then
MsgBox "Clicked in" ' whatever code you want to add, to make a subform
'visible, just change visible property to true
Else
MsgBox "clicked out" ' subform.visible= false
End If

Damon
 

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

Top