For example, I want to hide [label2],
how is the VBA should be ?
Where will this VBA code reside?
In the module (class module) associated with a Form or Report, with a Label
Control named "label2", in the appropriate event,
Me.label2.visible = False
will make that control invisible. Because the Controls are not properly
initialized at the time of the Open Event, don't expect it to work there.
If the code is to run in a Standard Module, you'll need to pass an object
variable for the Form, Report, or Control, or refer to the Form or Report
via the Forms or Reports Collection... as in the following sample
Forms!frmEmployeeUpdate!txtAddressLine1
References can be even more complex if the code is running in a main Form
and the Control resides in a Form embedded in a Subform Control.
Larry Linson
Microsoft Access MVP