Applies to
| Application Object | DataAccessPage Object | ObjectFrame Object | Report Object |
|---|---|---|---|
| BoundObjectFrame Object | Form Object | OptionButton Object | Section Object |
| CheckBox Object | Image Object | OptionGroup Object | SubForm Object |
| ComboBox Object | Label Object | Page Object | TabControl Collection |
| CommandButton Object | Line Object | PageBreak Object | TextBox Object |
| CustomControl Object | ListBox Object | Rectangle Object | ToggleButton Object |
When used with the Application object, this property returns or sets whether Access is minimized. For other objects, you can use the Visible property to show or hide a form, report, form or report section, data access page, or control. This property is useful when you want to use information on a form without showing the form. For example, you can use the value of a control on a hidden form as query criteria. Read/write Boolean.
Syntax
expression.Visible
expression Required. An expression that returns one of the objects in the Applies to list.
Remarks
For the Application object:
- You can set the
Visibleproperty of theApplicationobject only by using Visual Basic for Applications (VBA) code. - When a user launches an application, the
VisibleandUserControlproperties of theApplicationobject are both set toTrue. WhenUserControlis set toTrue, you can't set the object'sVisibleproperty toFalse. - When Automation (formerly called OLE Automation) creates an
Applicationobject, theVisibleandUserControlproperties of the object are both set toFalse.
For all other objects:
- You can set this property by using the object's property sheet (for sections and all controls except page breaks), a macro, or Visual Basic.
- For forms, reports, and data access pages, you must set this property by using a macro or VBA.
- For controls, you can set the default for this property by using the default control style or the
DefaultControlproperty in VBA. - The
Visibleproperty has no effect on a column in Datasheet view. To specify whether a column is visible in Datasheet view, use theColumnHiddenproperty. - To hide an object when printing, use the
DisplayWhenproperty. - You can use the
Visibleproperty to hide a control on a form or report by including the property in a macro or event procedure that runs when the Current event occurs. For example, you can show or hide a congratulatory message next to a salesperson's monthly sales total in a sales report, depending on the sales total.