Home Access 2003 Form Add Fields to Forms and Reports
Search MS Office A-Z   |   Search Web Pages/ Design A-Z

Add Fields to Forms and Reports

Open the Northwind Database. Select Tables in the left column within the Database window and then double-click Shippers in the column on the right. When the Shippers table appears on-screen, open the Format menu, choose Subdatasheet, and click Remove. (A subdatasheet is a nonessential Access feature that’s irrelevant to this tutorial, so that’s why we’re getting it out the way.) Now review the fields in the table, open the File menu, click Save to save the layout changes, and close the table.

Let’s make an AutoForm from this table that you’ll use later on. With Shippers selected in the Database window, open the Insert menu and click AutoForm. Now, open the File menu and click Save. In the Save As dialog box that displays, typeSmart Computing Shippersin the Form Name fieldand click OK. Close the form.

Back in the Database window with the Shippers table entry selected, click the Design button to open the Shippers table in Design view

Use An Existing Table

In the Shippers table, let’s add two rows after CompanyName to represent two new fields: one for the ZIP code and the other for email addresses. Move the mouse pointer to the selector at the far left end of the Phone row. When the pointer becomes an arrow, click your mouse and drag down so that the Phone row and the blank row below are selected, and then right-click the selected rows (see Figure 1) and choose Insert Rows. After following these steps, you’ll see two blank rows added directly above the Phone row.

Click inside the Field Name column of the first blank row you just added and typeZIP. Press the TAB key. You’ll see the default data type of Text appear in the field on the right; this is correct for ZIP codes, so press TAB again. Now, in the next field on the right side, typeFive-digit U.S. postal codefor local branch for the Description column. (The Description column is optional, so our entries are only suggestions.)

Press ENTER to move down to the following row. Here, typeEmail Address and press TAB. Click the drop-down arrow, select Hyperlink from the list, and press TAB. In the field below the Description column, typeAddress forprimaryshipper contact. In the lower pane (at the bottom of the window), click inside the Caption field (below the General tab). TypeEmail Address so the column heading will be easier to read (which you’ll see in another view of the table), and click Save from the File menu to save the table. Next, click the View button from the toolbar (at the top of the window) to go to Datasheet view.

Enter Data In The Table

Let’s add values in the new fields for the shipper Speedy Express. Click inside the first row of the ZIP column and type97205. Press TAB. Right-click the next field, choose Hyperlink, and click Edit Hyperlink. In the Link To column, select Email Address. In the Text To Display field, typeJohn Doe. In the Email Address field, typeJohnDoe@smartcomputing.com(of course, this isn’t areal email address) and press TAB. Access will then edit the address to the hyperlink format of “mailto: JohnDoe@smartcomputing.com.” Click OK.

Now you should see an underlined link in the first row below the Email Address column; clickJohn Doe in the Speedy Express record. A new email message with the John Doe email address entered in the To field should open in your default email program. Close the new message without saving it and (if necessary) close your email program. You can now close the Shippers table, as well.

Edit The Form

In the Database window, click Forms and open the Smart Computing Shippers form. Click the View button to switch to Design view. If the list of fields in the Shippers table isn’t in view, open the View menu and click Field List. Note that the two new fields are in the list. We could just add those two fields to the form, but it’s easier to delete the existing fields in the form and start from scratch.

Begin by clicking the Detail bar in the Smart Computing Shippers form. Open the View menu and click Properties. On the Format tab of the Section Detail property sheet, type2” in the Height field to edit the amount and then close the property sheet. Next, open the Edit menu and click Select All. Then, open the Edit menu again and click Delete.

In the field list, click ShipperID. Press the SHIFT key and click Phone. Now that all five fields are selected, drag and drop the fields to the form so that they are one inch from the left and a couple of rows from the top. Open the Format menu, choose Vertical Spacing, and click Increase (see Figure 2).

Click the View button again to go to Form view, where you’ll notice that the five fields now reside within the form. Click Save from the File menu to save your changes. You can now close the form and exit Access.



Home Access 2003 Form Add Fields to Forms and Reports
Search MS Office A-Z   |   Search Web Pages/ Design A-Z