hiding controls on a form

  • Thread starter Thread starter RickB
  • Start date Start date
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
 
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
 
Back
Top