Use Labels or Other Controls for Record Navigation

Problem

You don’t want to use images for the navigation buttons on your pages; you’d prefer to simply use labels that say “Previous”, “Next”, and so forth.

Solution

The default navigation images function as they do because each is a member of a particular class. You can use another type of control for navigation by adding the correct class name to the control’s ClassName property.

Our solution, found in the Custom Nav Text DAP in the sample database, uses labels to create the look shown in Figure 13-5.

This page uses navigation labels instead of images

Figure 13-5. This page uses navigation labels instead of images

To use labels as navigation controls, follow these steps:

  1. Create a new page and add whatever data you’d like.

  2. Delete all navigation control buttons from the navigation section.

  3. Place labels in the navigation control section for each navigation function (First, Previous, Next, Last).

  4. Select the “First” label and view its properties sheet. The ClassName property should read:

    MSTheme-Label
  5. Change the ClassName property so that it includes the appropriate class for the first navigation button, msoNavFirst. The ClassName property should now read:

    MSTheme-Label msoNavFirst
  6. Change the ClassName properties for each navigation control to include the class name for its function. Table 13-1 lists all the classes for navigation controls.

    Table 13-1. Navigation functions and their ...

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.