Microsoft Access 2010 Bible

(Rick Simeone) #1

Chapter 19: Advanced Access Form Techniques


701


Note
Developers often use the term tab when referring to the pages of a tabbed dialog box. In this chapter, the
terms page and tab are used interchangeably.


A tab control consists of a number of Page objects, each a member of the control’s Pages collec-
tion. Each page includes a Controls collection consisting of the controls that have been added to
that page. A page is added to the Pages collection with the Add method of the Pages object;
whereas a page is removed from the dialog box with the Pages object’s Remove method. From
the user interface, the quickest and easiest way to add or delete a page is to right-click the control
and select the appropriate command from the shortcut menu (see Figure 19.14).

FIGURE 19.14

The tab control’s shortcut menu contains relevant commands.


Using the Insert Page and Delete Page methods to add new pages or delete existing pages
from a tab control is not very practical for a number of reasons:

l Both methods require the form to be in Design view before they’re able to modify the tab
control.
l The Insert Page method doesn’t return a handle to the new tab. Therefore, it’s difficult,
if not impossible, to manipulate the properties of the new tab.
l The Delete Page method acts on the tab with the highest index and doesn’t accept an
index or page name as an argument. So, you have to be very careful to make sure you’re
actually removing the tab you think you are.

In addition to the Insert Page and Delete Page methods, the tab control contains the rele-
vant properties shown in Table 19.1. Use these properties to tailor the tab controls in your applica-
tions to suit the needs of your users.
Free download pdf