hiding controls on a form

R

RickB

How can one globally set the Visible property to False to all controls on a
form without naming each control individually when a New Record is selected.

Thank you in advance,

-rick
 
M

MacDermott

Dim ctl as Control
For each ctl in Me.Controls
ctl.visible=false
next

This will work unless you have some controls (like the dreaded CommonDialogs
control) which are never visible, and thus don't have a visible property.
If you have controls like that on your form, you'll need to trap the error
they produce.

HTH
 

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