SECTION 3
Lesson 3.2: Advanced Form Controls

   

 

 

In this exercise you will experiment with the different attributes a form control can have.

1.                   

Open the Lesson 3.2 database file from the Section 3 folder of your Exercise Files.

 

 

 

2.                   

Click the Forms object in the Database window and then double-click Create form by using Wizard. When the Form Wizard appears, select Table: Vehicles from the combo box and then click the (>>) button to copy all fields:

 

 

The default settings the Wizard uses to create a table are fine for our purposes, so click Finish. The new form will open:

 

 

 

3.                   

Open the new form in Design view. Move your mouse cursor just above the Form Footer bar until your mouse turns into (). Click and drag your mouse down about 1.5”, using the side ruler for measure.

Open the Properties for the Year text box, click the Format tab, and change the Format to General Number.

Do the same for the Number of Cylinders text box.

 

 

4.                   

Click the combo box at the top of the Properties window and select Form from the list.

In the Format tab, click the () icon beside the Picture field. When the Insert Picture dialogue box appears, select the background picture file from the Section 3 folder of your Exercise Files folder.

 

 

 

5.                   

Use the Toolbox to insert a Text field underneath the Cylinders combo box:

 

 

 

6.                   

Open the Properties of the new text label.

Under the Format Tab, change the Caption to Horsepower.

Change the Special Effect to Shadowed.

 

 

Drag the size of the of the Horsepower label to fit the contents. Drag the size of the Horsepower text field to approximately the same size as the Year text field:

 

 

Open the Properties of the new text field.

Under the Format tab, change the Format to General Number.

Under the Data tab, change the control source to =[Number of Cylinders]*39.66.

Change the Locked field to Yes.

 

 

7.                   

Close the form Design view and save the changes. Back in the Database window, double-click the Vehicles form to display its contents:

 

 

Try choosing a few different numbers of cylinders to see how the horsepower changes, but do not add any new records by using the (>*) button.

 

 

8.                   

Close the form and save the design changes when prompted.

 

 

9.                   

Close Microsoft Access 2003.