Applies To ActiveX control, Bound Object Frame control, Chart control, Check Box control, Combo Box control, Command Button control, Image control, Label control, Line control, List Box control, Option Button control, Option Group control, Page, Page Break control, Rectangle control, Subform/Subreport control, Tab control, Text Box control, Toggle Button control, Unbound Object Frame control.
Description
You can use the IsVisible property in Visual Basic to determine whether a control on a report is visible.
Setting
The IsVisible property uses the following settings.
Setting | Description |
True (–1) | (Default) The control is visible. |
False (0) | The control isn't visible. |
See Also HideDuplicates property.
Example 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 |
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If Me!CategoryID.IsVisible Then
Me!Line0.Visible = True
Else
Me!Line0.Visible = False
End If
End Sub