Visible Property

Applies To   ActiveX control, Bound Object Frame control, Chart control, Check Box control, Combo Box control, Command Button control, Form, Form section, Image control, Label control, Line control, List Box control, Option Button control, Option Group control, Page, Page Break control, Rectangle control, Report, Report section, Subform/Subreport control, Tab control, Text Box control, Toggle Button control, Unbound Object Frame control.

Description

You can use the Visible property to show or hide a form, report, form or report section, or control. This may be useful if you want to maintain access to information on a form without it being visible. For example, you could use the value of a control on a hidden form as the criteria for a query.

Setting

The Visible property uses the following settings.

Setting

Description

Visual Basic

Yes

(Default) The object is visible.

True (–1)

No

The object is not visible.

False (0)


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 and reports you must set this property by using a macro or Visual Basic.

For controls, you can set the default for this property by using the default control style or the DefaultControl method in Visual Basic.

Remarks

The Visible property has no effect on a column in Datasheet view. To specify whether a column is visible in Datasheet view, you use the ColumnHidden property.

To hide an object when printing, you use the DisplayWhen property.

You can use the Visible property 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.

Note There is also a Visible property of the Application object that can be set to cause the application to be invisible. This property can only be set by using Visual Basic.

See Also   Current event, DisplayWhen property, Format event, Transparent property, Visible property (Application object).