Home Access 2002 Forms A Few Techniques For Better Forms   |   Search MS Office A-Z   |   Search Web Pages/ Design A-Z

A Few Techniques For Better Forms

In Access, you use a form to enter records and view them on your computer screen. A form can be generated instantly with an AutoForm, while the Form Wizard can create well-designed forms in just a few more seconds. But you can also design a form from scratch to get it just the way you want it.

Even if you don’t see the need to design forms on your own, we suggest you give this tutorial a try. It will help you learn more about how a form works, which will help you modify the forms you’ve created under any method.

 Create A Form

Suppose you’re a human resources manager at Northwind Trading. The Employees form provides you with detailed records with all the information about each employee. Still, you’d also like to have a simple form that provides a few key details: employees’ names, titles, and supervisors (ReportsTo). You can create a simple form from scratch to view these records.

Open the Northwind.mdb database in the Samples subfolder of your Microsoft Office folder. Assuming you have made a copy (or have a backup) of the Northwind database, open the file. In the Database window, click the Forms button. Click New. Click Design View to highlight it, and from the drop-down menu at the bottom, choose Employees, and click OK.

Access displays a blank form with grid dots in design view. Maximize this window. Note that there’s an open Employees list box with all the fields in the Employees table. Rulers and the toolbox should also be displayed, if not, choose View, Ruler or View, Toolbox.

Before we begin to add elements to the form, let’s widen it. Move the mouse pointer to the right boundary of the grid. When the pointer becomes a double-arrow with bar, drag it to the 6-inch mark on the horizontal ruler and release. Choose File, Save As. In the top field, type SC Test Form. Make sure the bottom field is Form and click OK.

 Design The Form

First you’ll create a form title. In the toolbox, click the Aaicon and drag the pointer to the grid. With the crosshairs about two rows from the top and 2 inches from the left, draw a box about 2 inches wide by 0.5 inches long. Use the horizontal and vertical rulers to help size the box.

With the cursor flashing in the box, type Staff Positions. Click outside the box and then click the box again to select it. On the Formatting toolbar, the Font should be Tahoma; open the Font Size drop-down menu, and select 20; click the Center icon to center the text.

In the Employees field list, click FirstName. Drag it to the 1-inch by 1-inch mark and release. Access creates two controls: a label and a text box. The label First Name is on the left; in Form view, the label control identifies the field and always displays First Name. The text box FirstName is on the right; this control displays the first name for that particular record: Nancy, Andrew, etc.

Let’s add the other fields. Click LastName, drag it to the grid, and drop it 1 inch from the left and 1.5 inches from the top. Next, drag the Title field so it is 5 inches from the left and 1 inch from the top. Finally, scroll down to the end of the Employees field list and select ReportsTo. Drag it to the grid and drop it 5 inches from the left and 1.5 inches from the top.

 Align The Controls

Let’s make sure the fields are aligned properly. Click the FirstName text box, press SHIFT, and click the LastName text box. Choose Format, Align, Left to make sure the text boxes are aligned at the left. Using the same procedure, select the Title and ReportsTo text boxes and align them left, as well.

Now we’ll align the fields horizontally. Click the FirstName text box, press SHIFT, and click the Title text box. Choose Format, Align, Top. Using the same procedure, align the LastName and ReportsTo fields.

Click View to see the form you created in Form view. The form looks OK, if rather bland. But a little of the text of the Title field (such as Sales Representative in record #1) is truncated. Click View to return to Design view.

 Modify The Form

Click the Title text box to select it. Move the cursor to the middle select handle on the right. When the pointer turns to a double-arrow, drag it right to the 6.25-inch mark. Perform the same operation on the ReportsTo text box.

Select the Staff Positions title. On the Formatting toolbar, open the Font/Fore Color palette (click the down arrow along the right side) and select a blue patch. Open the Fill/Back Color palette and select the white patch.

Press the CTRL key and tap the Right arrow key once. Notice that the title box is nudged to the right. Hold down the SHIFT key and tap the Right arrow key seven or eight more times to re-center the title.

Click View. It’s not a work of art, but the form does convey the information you need. Close the form and save it. To delete the form from the Database window, select SC Test Form, and press DELETE.