ACC2000: Tab Control Inserted on Another Tab Control Remains on TopID: Q208808
|
Novice: 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.
Tab controls can not be nested.
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, including, but not limited to, the implied warranties of
merchantability and/or fitness for a particular purpose. This article assumes that you
are familiar with the programming language being demonstrated and the tools used to
create and debug procedures. Microsoft support professionals 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 needs. If you have limited
programming experience, you may want to contact a Microsoft Certified Solution Provider
or the Microsoft fee-based consulting line at (800) 936-5200. For more information about
Microsoft Certified Solution Providers, please see the following page on the World Wide Web:
http://www.microsoft.com/mcsp/For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://www.microsoft.com/support/supportnet/overview/overview.asp
Private Sub TabControlMain_Change()
If TabControlMain.Value = 1 Then
TabControlEmbedded.Visible = True
Else
TabControlEmbedded.Visible = False
End If
End Sub
Form controls cannot be placed inside other form controls. The only exception to this is the Subform/Subreport control, which can contain a form that has additional controls. Even when you place a tab control on top of another tab control, they are both associated with the form, not with each other.
You can demonstrate this by using the form you design in the "Steps to Reproduce Behavior" section later in this article. Once the form is showing in form view, open the Immediate Window by typing CTRL+G and type each of the following statements followed by the ENTER key.
?Forms!Form1!TabControlMain.Parent.NameYou will see that the Parent for each of the tab controls is the form itself, not the other tab control.
?Forms!Form1!TabControlEmbedded.Parent.Name
For 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.
Additional query words: prb multiple pages
Keywords : IntpCstm
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: July 6, 1999