VBA Question (Making form elements Visible)

  • Thread starter Thread starter andyw
  • Start date Start date
A

andyw

Hi,

I currently have this piece of code:

Private Sub Command19_Click()
Toggle20.Visible = True
End Sub

So when the button is pressed toggle20 becomes visable.

What do I need to add to this to to enable the toggle20 to become
hidden once again if the button is pressed once more?
 
hi,
private sub commadn19_click()
if toggle20.visible = true then
toggle20.visible = false
else
if toggle20.visible = false then
toggle20.visible = true
end if
end if
end sub
 
Andy,

Try this:
Private Sub Command19_Click()
Toggle20.Visible = Not Toggle20.Visible
End Sub

Dale Preuss
 
... even more elegant...:

Private Sub command19_click()
Me.toggle20.Visible = Not (Me.toggle20.Visible)
End Sub

Fritz
 

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


Back
Top