Home Access 2002 Forms Create Forms with Tabs   |   Search MS Office A-Z   |   Search Web Pages/ Design A-Z

Create Forms with Tabs

You use a form in Access to enter data into your database and view it on-screen. We spend so much time and effort entering records that even slight changes in form design can greatly increase efficiency. In this tutorial, we’ll build a down-and-dirty form from scratch. We’ll show you a few techniques that can make entering data simpler and improve your field display.

 Create A Form

Open the Northwind.mdb database in the Samples subfolder of your Microsoft Office folder. Assuming you’ve made a copy (or have a backup) of the Northwind database, open the file. In the Database Window, click the Tables button and double-click the Customers table to open it. Briefly review the fields and data in the table and close it.

In the Database Window, click Forms and click New. In the New Form dialog box, select Design View. Click the down arrow in the Choose The Table Or Query From Where The Object’s Data Comes From field, click Customers, and click OK. Maximize the Form Design window.

A field list for the Customers table should be in view. If not, choose View and then Field List. Click Company Name, drag it to the Detail section of the form and drop it 1 inch from the Left (use the horizontal ruler) and two rows of dots from the Top. Click Contact Name and drag and drop it 1 inch from the Left and two rows of dots below Company Name. Using the same measurements, drag and drop Contact Title below Contact Name.

Scroll down to Country in the field list; drag and drop it 3.25 inches from the Left and two rows of dots from the Top. Click Phone and drag and drop it 3.25 inches from the Left and two rows of dots below Country. Using the same measurements, drag and drop Fax below Phone.

 Modify The Form

Click View and view the completed form. Press Tab five times slowly to see the order in which the focus jumps from field to field. Click your pointer in the Company Name box. Using the Next Record button at the bottom of the form, scroll through a few records; click the First Record button to return to the initial record.

Because most of Northwind’s customers are overseas, let’s assume the preferred method of communication is via fax. We’ll place the Fax field above Phone to reflect this preference.

Click View. Select the Phone field (the box on the right is the field; the box on the left is the accompanying label). Move the pointer to the top of the Phone field until it changes to an open hand. Drag and drop it anywhere below the Fax field.

Select the Fax field. Move the pointer to the top border of the Fax field. When the pointer becomes an open hand, drag and drop the field two rows of dots below Country. Select the Phone field and drag it two rows of dots below the Fax field.

 Change The Tab Order

Click View to see the changes you made. Press Tab three times so the focus is on the Country field. Press Tab again. Notice that the focus still jumps to the Phone field, which you had dragged from the field list before dragging the Fax field. Press Tab again, and the focus jumps up to Fax.

Let’s change the Tab Order so the focus jumps to Fax before Phone. Click View and then Tab Order to open the Tab Order dialog box. Move the pointer to the Fax field selector (the small box on the left of the Fax row). When the pointer becomes an arrow facing right, click to select the Fax field. Click the Fax selector box again and drag it up until you see a heavy horizontal line above the top of the Phone row. Release your mouse; the Fax row should now be above the Phone row. Click OK.

Click View. Press Tab five times and watch how the focus moves. The Tab Order should now follow the field order, top to bottom and left to right.

 Create Additional Space

Currently there is only one record shown on each page. You can change the display to show several records on each page.

Click View. Double-click the Form selector, the small box to the left of the horizontal ruler. (As an alternative, you can click the Select Object drop-down arrow on the Formatting toolbar and choose Form.) In the Form dialog box, look on the Format tab and click in the Default View field. Click the drop-down button and choose Click the drop-down button and choose Continuous Forms. Close the Form dialog box.

Click View. You can now view more data on each page, but there’s a good deal of empty space between records.

Click View again. In the Design section, note that you have no fields below the 1-inch vertical line. You can dispense with that extra inch of vertical space. Double-click the Design bar (or select Design from the Select Object box). On the Format tab of the Design property sheet, select 2” in the Height section. Type 1”and close the property sheet. Click View to see the changed form.

 Modify Records For Printing

Although forms are not primarily designed for printing hard copy, many users find they occasionally want to print out a record for, say, a customer or supplier. Often, however, internal client records may include data you don’t want to release to external parties. You can hide individual fields for printing while keeping them in your on-screen display. Just for the sake of this tutorial, we’ll hide the Fax field when printing.

Click View. Right-click the Fax field and choose Properties. The property sheet Text Box: Fax opens. Click in the Display When property of the Format tab. Click the down-arrow button and choose Screen Only. Close the property sheet.

Click View. Choose Edit and Select Record. Click File and Print. In the Print Range section, click Selected Record(s) and click OK. The record prints without the Fax field.

Click View. If you’d like to save the form for future reference, click File and Save, type Smart Computing Form Navigation,and click OK. Otherwise, close the form, click No, and close your database.