Using the Addin

To test the add-in, open any Access 2007 database (or create a new database). As in Figure 16.32, you should see a new Visual Studio Add-in tab on the Ribbon with a group called "Create Access Objects" containing three buttons. There is no need to manually add the Ribbon, or even to close and reopen the database; the Ribbon appears immediately (a refreshing change from the struggle you have to go through in order to get a custom Ribbon to appear from an Access add-in).

FIGURE 16.32

A new tab and group created by the add-in.

- v Excel to Word

Home Create External Data Database Tools Add-Ins Extras 1

H Create New Table

Iftlj Create New Form

m Create New Report

1 Create Access Objects

Clicking the "Create New Table" button creates a new table with several fields of different data types, the "Create New Form" button creates a new form with the new table as its record source and several controls of different types, and the "Create New Report" button creates a new report, also with the new table as its record source and several controls of different types. Figure 16.33 shows the new table in design view.

FIGURE 16.33

A new table created by the add-in.

FIGURE 16.33

A new table created by the add-in.

Figure 16.34 shows the new form; the new report is similar.

FIGURE 16.34

A form created by the add-in.

FIGURE 16.34

A form created by the add-in.

The form is called Forml (or another number); it can't be renamed in code, either in the SSeSSHI Visual Studio add-in or directly in Access VBA, because the Name property of the Form object is read-only when the form is created using the CreateForm method (and similarly for the CreateReport method).

0 0

Post a comment