Share via

IsVisible Property [Access 2003 VBA Language Reference]

You can use the IsVisible property in Visual Basic to determine whether a control on a report is visible. Read/write Boolean.


expression Required. An expression that returns one of the objects in the Applies To list.


The IsVisible property uses the following settings.

Setting Description
True (Default) The control is visible.
False The control isn't visible.

Note  You can set the IsVisible property only in the Print event of a report section that contains the control.

You can use the IsVisible property together with the HideDuplicates property to determine when a control on a report is visible and show or hide other controls as a result. For example, you could hide a line control when a text box control is hidden because it contains duplicate values.


The following example uses the IsVisible property of a text box to control the display of a line control on a report. The report is based on a Products table and uses three controls with the following properties.

Properties Line control Text box #1 Text box #2
Name Line0 CategoryID ProductName
ControlSource CategoryID ProductName
HideDuplicates Yes No
Left 0 0 2.0
Top 0 .1 .1
Width 4.0 1.0 1.0

Paste the following code into the Declarations section of the report module, and then view the report to see the line formatting controlled by the IsVisible property:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    If Me!CategoryID.IsVisible Then
        Me!Line0.Visible = True
        Me!Line0.Visible = False
    End If
End Sub

Applies to | BoundObjectFrame Object | CheckBox Object | ComboBox Object | CommandButton Object | CustomControl Object | Image Object | Label Object | Line Object | ListBox Object | ObjectFrame Object | OptionButton Object | OptionGroup Object | Page Object | PageBreak Object | Rectangle Object | SubForm Object | TabControl Collection | TextBox Object | ToggleButton Object

See Also | HideDuplicates Property