ACC97: Disabled Tab Control Page Remains Visible (161011)
The information in this article applies to:
This article was previously published under Q161011 Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
When the Enabled property of a page on a tab control is set to False, you
can still click the tab and see its controls and the data they contain.
However, you cannot change any of the data.
RESOLUTION
There are two methods you can use to hide the data on a disabled tab
control page.
Method 1
Set the Visible property of the tab control page to False in the Load
event of the form. This makes the tab control page and its tab invisible.
Add the following procedure to the Load event of the form, substituting
the name of your own tab control:
Private Sub Form_Load()
If Me!TabCtl0.Pages(1).Enabled = False Then
Me!TabCtl0.Pages(1).Visible = False
End If
End Sub
Method 2
Set the Visible properties of the controls on the tab control page to
False in the Load event of the form. This hides the controls on that
page, but allows the tab to remain visible. Add the following procedure
to the Load event of the form, substituting the name of your own tab
control and page controls:
Private Sub Form_Load()
If Me!Tabctl0.Pages(1).Enabled = False Then
Me!TabCtl0.Pages(1).Controls![HireDate].Visible = False
Me!TabCtl0.Pages(1).Controls![ReportsTo].Visible = False
End If
End Sub
STATUS
This behavior is by design.
REFERENCES
For more information about the tab control, search the Help Index for "tab
controls."
Modification Type: | Major | Last Reviewed: | 9/25/2003 |
---|
Keywords: | kbprb KB161011 |
---|
|