VBA to hide / show LABEL or TEXT box

  • Thread starter Thread starter Martin
  • Start date Start date
Martin said:
VBA to hide / show LABEL or TEXT box ? How?

Set its Visible property. For example,

' code running on the form containing the object:
Me!NameOfControl.Visible = False ' hide it
Me!NameOfControl.Visible = True ' show it again

' code running somewhere else:
Forms![NameOfForm]!NameOfControl.Visible = False
Forms![NameOfForm]!NameOfControl.Visible = True

If a label is attached to text box, hiding the text box will also hide
the label.
 
Thanks!

Dirk Goldgar said:
Martin said:
VBA to hide / show LABEL or TEXT box ? How?

Set its Visible property. For example,

' code running on the form containing the object:
Me!NameOfControl.Visible = False ' hide it
Me!NameOfControl.Visible = True ' show it again

' code running somewhere else:
Forms![NameOfForm]!NameOfControl.Visible = False
Forms![NameOfForm]!NameOfControl.Visible = True

If a label is attached to text box, hiding the text box will also hide
the label.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

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

Back
Top