ACC2000: Tab Control Inserted on Another Tab Control Remains on Top (208808)
The information in this article applies to:
This article was previously published under Q208808 SYMPTOMSNovice: Requires knowledge of the user interface on single-user computers.
When you place a tab control on any page of another tab control, and then
view the form in Form view, the embedded tab control is visible from any
page of the main tab control.
CAUSE
Tab controls can not be nested.
RESOLUTION
You need to use Visual Basic for Applications code to set the Visible property of the tab control that you want to appear to be "nested" within another tab control. Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. - Follow steps 1 through 10 in the "Steps to Reproduce Behavior" section later in this article.
- Open the form in Design view.
- In the Object list (the drop-down list on the far left of the
Formatting toolbar), click TabControlMain.
- Right-click TabControlMain, and then click Properties.
- Click the Event tab, and then click the OnChange property box.
- Click the Build button (...) to the right of the OnChange property box.
- In the Choose Builder dialog box, click Code Builder, and then click OK. This opens the Visual Basic Editor.
- Set the OnChange property to the following event procedure:
Private Sub TabControlMain_Change()
If TabControlMain.Value = 1 Then
TabControlEmbedded.Visible = True
Else
TabControlEmbedded.Visible = False
End If
End Sub
- To return to the form, on the View menu, click Microsoft Access.
- On the View menu, click Form View.
- Click Page 1 of TabControlMain, and then click Page 2. Note that TabControlEmbedded is visible only on Page 2.
NOTE: The Value property of a tab control contains the index number of the current Page object. There is one Page object for each tab in a tab control. The first Page object always has an index number of 0, the second has an index number of 1, and so on.
REFERENCESFor more information about the tab control, click Microsoft Access Help on the
Help menu, type tab control in the Office Assistant or
the Answer Wizard, and then click Search to view the topics
returned.
For more information about the Parent property, click Microsoft Access Help on the
Help menu, type parent property in the Office Assistant or
the Answer Wizard, and then click Search to view the topics
returned.
Modification Type: | Major | Last Reviewed: | 6/23/2005 |
---|
Keywords: | kbprb KB208808 |
---|
|