ACC97:Tab Control Inserted on Another Tab Control Remains on Top

Last reviewed: February 13, 1998
Article ID: Q180755
The information in this article applies to:
  • Microsoft Access 97

SYMPTOMS

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.

RESOLUTION

The following example demonstrates how to use an event procedure that sets the Visible property of the embedded tab control to True only when a particular page has been selected.

  1. Follow steps 1 - 10 in the "Steps to Reproduce Behavior" section later
     in this article.

  2. Open the form in Design view.

  3. In the Object list (the drop-down list on the far left of the
     Formatting toolbar), click TabControlMain.

  4. Right-click TabControlMain, and then click Properties.

  5. Click the Event tab, and then click the OnChange property box.

  6. Click the Build button (...) to the right of the OnChange property
     box.

  7. In the Choose Builder dialog box, click Code Builder, and then click
     OK.

  8. 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

  9. On the View menu, click Form view.

 10. 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.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Start Microsoft Access and open any database.

  2. In the Database window, click the Forms tab, and then click New.

  3. In the New Form dialog box, click Design view, and then click OK to
     create a form that is not based on any table or query.

  4. On the View menu, click Toolbox if the toolbox is not already visible;
     click the Tab Control button on the Toolbox toolbar, and then create a
     tab control in the detail section of the form.

  5. On the View menu, click Properties; set the control's Name property
     to TabControlMain.

  6. Click Page 2 of TabControlMain.

  7. Create another tab control on Page 2 of TabControlMain.

  8. On the View menu, click Properties; set the Name property of the tab
     control to TabControlEmbedded.

  9. On the View menu, click Form view.

 10. Click Page 1 of TabControlMain, and then click Page 2. Note that
     TabControlEmbedded is visible on both pages.

REFERENCES

For more information about tab controls, search the Help Index for "tab controls," or ask the Microsoft Access 97 Office Assistant.


Additional query words: prb multiple pages
Keywords : IntpCstm
Version : WINDOWS:97
Platform : WINDOWS
Hardware : x86
Issue type : kbprb


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 13, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.