Display Multiple Pages of Information on One Form

Problem

You have a large number of fields that you need to display on a form. If you place them all on the form at once, it looks too complicated. You need some way to group them by category and display only the ones that correspond to each category as the user works through all the groups.

Solution

Access 97 introduced the native Tab control, which is useful for organizing information into multiple pages. Simply organize your fields into categories, creating one page on the Tab control for each category.

Load 02-05.MDB and open frmMain. This sample form (shown in Figure 2-8) contains a Tab control. By clicking on a tab, you cause one of the four possible pages of the form to be displayed in the Tab control section.

The sample form, frmMain

Figure 2-8. The sample form, frmMain

To create your own version of a multipage form, follow these steps:

  1. Create the table and/or query on which you want to base your form (tblSample in 02-05.MDB). Make sure your data includes a primary key (ID in tblSample).

  2. Open your form (frmMain in 02-05.MDB) in design view. Insert a Tab control on the form.

  3. Set at least the properties shown in Table 2-3 for the form itself.

    Table 2-3. Form property values for the main form, frmMain

    Property

    Value

    RecordSource

    tblSample (or the name of your table or query)

    AllowAdditions

    No

    ViewsAllowed

    Form

    RecordSelectors

    No

  4. Right-click ...

Get Access Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.