Can I use a single toggle button to Hide or Show a form?

G

Guest

I have tried to use a single toggle button to show or hide a form, but the
best I can manage is having to use two buttons.

Is it possible to use just the one button to toggle between show/hide?
 
F

fredg

I have tried to use a single toggle button to show or hide a form, but the
best I can manage is having to use two buttons.

Is it possible to use just the one button to toggle between show/hide?

Sure! But the toggle button can't be on the form that you are making
visible or not, as once it's not visible you can't click on the toggle
button.

What version of Access?
Access 2000 or newer?

Code the toggle button Click event:

If CurrentProject.AllForms("AFormname").IsLoaded Then
forms!AFormName.Visible = Not forms!AFormName.Visible
If ToggleName.Caption = "Make Visible" then
ToggleName.Caption = "Hide"
Else
ToggleName.Caption = "Make Visible"
Ehd If
End If
 

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