• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 2. Building Your First Access Ap... > Creating an Access Application from ...

Creating an Access Application from a Template File

When you launch Access 97, the Microsoft Access dialog offers you the option of creating a new database or opening an existing database, such as Northwind.mdb, the Northwind Traders sample database located in \Program Files\Microsoft Office\Office\Samples. If you choose to create a new database, you can open a do-it-yourself empty (blank) database or use the Database Wizard to create a database from one of the 22 database templates included with Access 97. Template files contain the definitions of Table, Form, and Report objects, plus the VBA code required to automate interaction of these objects. Template files also include a relatively small amount of optional sample data, which is useful for learning how to navigate a set of records.

To use the Database Wizard to create an example application from an Access 97 template, follow these steps:

Choose Programs, Microsoft Access from the Start menu to launch Access 97 and open the Microsoft Access dialog. (If you have Access open, you must close and relaunch Access to display this dialog.)

Select the Database Wizard option (see Figure 2.1). Click OK to open the New dialog.

Select one of the 22 database templates (*.mdz files) from which to build your new application (see Figure 2.2). Access stores its templates in \Program Files\Microsoft Office\Templates\Databases. This example uses the Contact Management.mdz template. Click OK to open the File New Database dialog.

Figure 2.1. Selecting the Database Wizard option in the Microsoft Access dialog.

Figure 2.2. Selecting the Contact Management template in the Databases page of the New dialog.

The Wizard proposes a default database with the name of the template plus a 1 suffix. The default location of the database file is the \My Documents folder. Accept the default name or shorten it to Contacts.mdb (see Figure 2.3). Click Create to generate an empty Jet 3.5 database file (Contacts.mdb) and start the Database Wizard.

Figure 2.3. Shortening the default database file name, Contact Management1.mdb, to Contacts.mdb.

The first dialog of the Database Wizard describes the tables that store user-entered and optional sample information in the new database (see Figure 2.4). Click Next to continue.

Figure 2.4. The first Database Wizard dialog.

The second Wizard dialog lets you add or remove optional fields of one of the three tables, and include sample data. Optional fields appear in italic type in the list. To add or remove an optional field of the Contact Information table, mark or clear the check box (see Figure 2.5). Mark the Yes, Include Sample Data check box for this example, and click Next to continue.


You can remove only the optional fields you add. You can't remove the standard set of fields that appear in Roman type.

Figure 2.5. Adding the optional Home Phone field to the Contact Information table and specifying inclusion of sample data in the tables of Contact.mdb.

The third Wizard dialog offers a selection of text colors and background colors or images for the data forms that the Wizard creates. As you select an item in the list, a sample of the style appears in the dialog (see Figure 2.6). Select a form style and click Next to continue.

Figure 2.6. Selecting text color and background color or images for data-entry forms.

The fourth dialog lets you choose a style for printed reports (see Figure 2.7). Pick a report style, such as the conservative Soft Gray, and click Next to continue.

You enter the title to appear on your forms and reports in the fifth Wizard dialog (see Figure 2.8). The default title is the name of the template file. Accept or edit the title.

Figure 2.7. Selecting the header and type styles for reports in the fourth Wizard dialog.

Figure 2.8. Accepting the default title, which appears on forms and reports.

If you have a bitmap (.bmp or .dib, device-independent bitmap) or vector (.wmf, Windows metafile, or .emf, enhanced metafile) image of a logo that's of a size suited to the header of your reports, mark the Yes I'd Like to Include a Picture check box. (The logo should be about 80 by 80 pixels or less.) Click the Picture button to open the Insert Picture dialog. Select the image file, and then click OK to insert the image and close the Insert Picture dialog.

Click Next to open the final Wizard dialog (see Figure 2.9). With the Yes, Start the Database check box marked, click Finish to add the objects whose properties you've specified to the database file you named in step 4.

Figure 2.9. The last Database Wizard dialog.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint