Core Training for Microsoft Access 2002

Simplifying Data Entry with Forms


Creating a Form Using a Wizard

1 To create a form, in the Database window, on the Objects bar, click Forms.
2 To start the Form Wizard, double-click the Create form by using wizard shortcut.
3 To select a table for the form, in the Form Wizard dialog box, click the arrow next to the Tables/Queries text box, and then in the Tables/Queries drop-down list, click Table: Customers.
4 To move the fields from the Available Fields: list to the Selected Fields: box, in the Form Wizard dialog box, click the >> (move all) symbol, and then click Next.
5 To preview one of the form layouts, in the Form Wizard dialog box, click the Datasheet option.
6 To select a layout for the form, on the column of predefined layouts, click Columnar, and then click Next.
7 To preview a style for the form, in the list of predefined styles, click Blends.
8 To select a style for the form, in the list of predefined styles, click Sumi Painting, and then click Next.
9 The default selection Open the form to view or enter information is fine. To finish creating the form, in the Form Wizard dialog box, click Finish.
10 The first record is visible in the form. To view the next record, in the lower-left corner of the Customers form, on the navigation toolbar, click the Next Record button.
11 To close the Customers form, in the upper-right corner of the screen, click the lower of the two Close buttons.

Refining Form Properties

1 To edit the properties of the Customers form, in the Forms pane, click Customers, and on the Database toolbar, click Design.
2 To change the font of a label, in the form, click the Customer ID label, and on the Formatting toolbar, click the arrow next to the Font box.
3 To select a font, click once above the scroll box on the Font scroll bar, and click Microsoft Sans Serif.
4 To change the font size of the selected Customer ID label, on the Formatting toolbar, click the arrow next to the Font Size box, and in the drop-down list, click 8.
5 To edit the CustomerID field properties, click the CustomerID text box, click the View menu, and click Properties.
6 To change the font of the CustomerID field, in the Text Box: Customer ID dialog box, click once below the scroll box on the scroll bar.
7 To select a font for the CustomerID field, click the Font Name property, type MS Sans Serif, and press ENTER.
8 To set a font size for the CustomerID field, click the arrow next to the Font Size box, in the drop-down list, click 8, and press ENTER.
9 To set a font weight for the CustomerID field, click the arrow next to the Font Weight box, and in the drop-down list, click Bold.
10 To select all the labels and fields in the form, click the Edit menu, and click Select All.
11 To change the font, click once above the scroll box on the Properties dialog box (the dialog box now displays Multiple selection on the title bar).
12 To select a font, in the Multiple Selection dialog box, click in the Font Name property box, type MS Sans Serif, and press ENTER.
13 To change the font size, in the Multiple Selection dialog box, click the arrow next to the Font Size box, and in the drop-down list, click 8.
14 To change the font weight, in the Multiple Selection dialog box, click once below the scroll box on the scroll bar, click the Font Weight property, click the arrow that appears, and in the drop-down list, click Bold.
15 To assign a color to the background of the controls, in the Properties dialog box, click once above the scroll box on the scroll bar, click Back Style property, click the arrow that appears, and in the drop-down list, click Normal.
16 To open the color palette, in the Multiple Selection dialog box, click the Back Color property, and click the ... button.
17 To select a background color for the controls, in the Color palette, click the pale yellow color box (first row, second from the left), click OK, and press ENTER.
18 To add more effects to the background of the selected controls, in the Multiple Selection dialog box, click the arrow next to the Special Effect property box, and in the drop-down list, click Shadowed.
19 To assign a color to the borders, click the Border Color property box, type the color value 32768, and press ENTER.
20 To deselect the controls, in the form, click the Detail section.
21 To change a label, in the form, click the First Name label, in the Label: FirstName_Label dialog box, click two times above the scroll box, click the Caption property, type Name, and press ENTER.
22 To set a picture for the background, in the form, click in the form selector.
23 To select a picture for the background, click once below the scroll box on the Form scroll bar, click the Picture property, and click the ... button.
24 To start inserting a picture, in the Insert Picture dialog box, double-click the Garden Company folder, and double-click the Catalog folder.
25 To finish inserting the tgc_bkgrnd picture file, click OK.
26 To close the Form dialog box, on the title bar of the dialog box, click the Close button.

Adding Controls to a Form

1 To enlarge the header section of the form, point to the horizontal line between the Form Header section selector and the Detail section selector until the pointer changes to a double arrow, press and hold down the mouse button, drag selector down to 1-inch mark on the vertical ruler, and release the mouse button.
2 To insert a logo in the Form Header section, in the toolbox, click the Image control (fifth row, first button).
3 To specify an area for the logo, position the mouse pointer in the upper-left corner of the Form Header section, press and hold down the mouse button, drag the mouse pointer to the intersection of the 3-inch mark on the horizontal ruler and the 1-inch mark on the vertical ruler, and release the mouse button.
4 To select an image for the logo, in the Insert Picture dialog box, double-click Garden Company, and double-click Catalog.
5 To open a file for the logo, in the Insert Picture dialog box, click OK.
6 To add a caption, in the toolbox, click the Label control (second row, first button), in the Form Header section, position the mouse pointer in the upper-right corner of the previous rectangle, press and hold down the mouse button, drag the mouse to the intersection of the 4.5-inch mark on the horizontal ruler and the .75-inch mark on the vertical ruler, and release the mouse button.
7 To add a caption to the label, type Customers, and press ENTER.
8 To open the Properties dialog box and edit the Customers label, click the View menu, and click Properties.
9 To change the font size of Customers label, click once below the scroll box on the Label: Label22 scroll bar, click the Font Size property, click the arrow that appears, and click 18.
10 To align Customers label, click once below the scroll box in the Label: Label22 scroll bar, click the Text Align property, click the arrow that appears, and click Center.
11 To close the Label: Label22 dialog box, on the title bar of the dialog box, click the Close button.
12 To resize the rectangular box to fit around the Customers text, click the Format menu, point to Size, and click To Fit.
13 To extend the form width, position the pointer over the right-edge of the Details section’s vertical line, when the pointer changes to a double-headed arrow, press and hold down the mouse button and drag it until it aligns with the 5-inch mark on the horizontal ruler, and release the button.
14 To insert a combo box in the Details section of the form, in the toolbox, click the Combo Box control (fourth row, first button).
15 To insert the combo box, position the pointer on the intersection of the 4-inch mark on the horizontal ruler and the 2-inch mark on the vertical ruler, press and hold down the mouse button, drag the mouse down until the pointer is aligned with the 2.2-inch mark on the vertical ruler and the 4.7-inch mark on the horizontal ruler, and release the mouse button.
16 To copy the formatting of a field text box to the new combo box control, click the Country field text box, on the Standard toolbar, click the Format Painter button, and click the combo box control.
17 To modify combo box control properties, click the combo box text box, click the View menu, and click Properties.
18 To enable the Country field to display a list of countries, in the Combo Box: Combo25 dialog box, click the Data tab, click the arrow next to the Control Source property box, and click Country.
19 To add the query to obtain the list, in the Combo Box: Combo25 dialog box, click Row Source, in the text box, type SELECT DISTINCT Customers.Country FROM Customers;, and press ENTER.
20 To change the caption of the combo box label to a new label, click the combo box label, and in the Label: Label26 dialog box, click the Format tab.
21 To set a caption for the new combo box label, in the Label: Label26 dialog box, in the Caption text box, type Country, and press ENTER.
22 To close the Label: Label26 dialog box, on the title bar of the dialog box, click the Close button.
23 To delete the original Country field text box and its label, click the Country field text box, and press DELETE.
24 To reposition the combo text box and its label, position the pointer over the combo text box, press and hold down the mouse button, drag the mouse under the Postal code label so the upper edges of combo text box and label are aligned with the 2-inch mark on the vertical ruler, and release the button.
25 To view the Customers form in Form view, on the Standard toolbar, click the View button.
26 To view the next record, at the bottom of the Customers form window, on the navigation toolbar, click the Next Record (right arrow) button.
27 To save the form and then close it, on the Standard toolbar, click the Save button, and then click the lower of the two Close buttons.

Creating a Form Using an AutoForm

1 To start creating a new form, on the Database toolbar, click the New button.
2 To use AutoForm to create the form, in the New Form dialog box, click AutoForm: Columnar.
3 To select a table, at the bottom of the New Form dialog box, click the text box arrow, click Categories, and then click OK.
4 To save the form after viewing it, on the Standard toolbar, click the Save button.
5 To save the form with the default name, Categories, click OK.
6 To edit the form in Design view, click the View menu, and click Design View.
7 To edit a label, click the Category Name label, click the View menu, and then click Properties.
8 To change the caption of the Category Name label, in the Label: CategoryName_Label dialog box, in the Caption property text box, type Name, and then press ENTER.
9 To edit a text box, in the form, click the CategoryID text box, and then in the TextBox: CategoryID dialog box, click the Data tab.
10 Note that Access provides the CategoryID value, which should not be changed. To disable the CategoryID text box control, click Enabled, click the arrow next to the Enabled box, and then click No.
11 To confirm that the Category ID field cannot be edited, click the View menu, and then click Form View.
12 To remove the record selector and the scroll bars in Design view, on the Menu bar, click View, and then in the drop down list, click Design View.
13 To remove the record selector, click the form selector, in the Form dialog box, click the Format tab, click Record Selector, click the arrow that appears, and then click No.
14 To remove the scroll bars, in the Form dialog box, click Scroll Bars, click the arrow that appears, and then, click Neither.
15 To close the Form dialog box, on the title bar of the dialog box, click the Close button.
16 To save the form, on the Standard toolbar, click the Save button.

Adding a Subform to a Form

1 To start defining a relationship between two tables in your database, click the Tools menu, and click Relationships.
2 To select two tables with a common field, in the Show Table dialog box, double-click Categories, and then double-click Products.
3 To close the Show Table dialog box, in the Show Table dialog box, click Close.
4 To start creating the relationship, in the Categories table, position the mouse pointer over the CategoryID field, press and hold down the mouse button, move the pointer inside Products table on CategoryID, and then release the button.
5 To create the relationship, in the Edit Relationships dialog box, click the Enforce Referential Integrity check box, click the other two check boxes, and then click Create.
6 To close the Relationships window by saving the changes, on the title bar of the Relationships window, click the Close button, and then, in the alert box that appears, click Yes.
7 To enlarge the form window, point to the upper edge of the Form Footer selector, until the pointer becomes a double arrow, press and hold down the mouse button, drag the pointer down to the 1-inch mark on the vertical ruler, and then release the button.
8 To activate the Control Wizards, in the toolbox, click Control Wizards button.
9 To start specifying an area for the subform, in the toolbox, click the Subform/Subreport button (sixth row, third button).
10 To specify the area for the subform, position the mouse under the bottom left corner of the Description text box, press and hold down the mouse button, drag the pointer to the lower right-corner of the form, and then release the mouse button.
11 The default selection Use existing Tables and Queries is fine. To move to the next step, click Next.
12 To select an existing table for the subform, in the SubForm Wizard, click the arrow next to the Tables/Queries text box, and then click Table: Products.
13 To select fields for the form, in the SubForm Wizard, in the Available Fields list, click ProductName, and then click the > button.
14 To move to the next step, in the SubForm Wizard, click Next.
15 To accept the default selections, in the SubForm Wizard, click Next.
16 To accept the default name Products subform as the name of the subform and to finish the process, click Finish.
17 To maximize the form window and view the results, on the title bar of form window, click the Maximize (middle) button, and on the Standard toolbar, click the View button.
18 To view all the fields in the subform, position the mouse pointer over the divider between the column headers Product Name and Category, press and hold down the mouse button, move the pointer (which is now a double arrow) to the left until the Product Name column shrinks to the desired size.
19 To change a category in the subform, in the Category column, click the first category box next to the product Magic Lily, click the box arrow, and then click Cacti.
20 To verify that the product Magic Lily has automatically repositioned itself based on the category, on the lower-left corner of the form, on the navigation bar, click the Next Record (right arrow) button.
21 To restore Magic Lily to the Bulbs category, in the subform, in the Category column, click the arrow, click once above the scroll box, and click Bulbs.
22 To return to Design view, on the Standard toolbar, click the View button.
23 To remove the CategoryID field so that a product's category cannot be changed, in the subform, click the CategoryID text box control, and then press DELETE.
24 To save the changes to the form, on the Standard toolbar, click the Save button.
25 To view the final layout of the Categories form, on the Standard toolbar, click the View button.
26 To close the form, in the upper-right corner of the window, click the lower of the two Close buttons.

Creating a Form and Subform with a Wizard

1 To start creating a subform within a form using a wizard, on the Database toolbar, click the New button.
2 To select the wizard and a table, in the New Form dialog box, click Form Wizard, click the text box arrow, click Categories, and then click OK.
3 To copy all the fields from the Available Fields pane to the Selected Fields pane, in the Form Wizard, click the >> (move all) button.
4 To select a table for the subform, in the Form Wizard, click the Tables/Queries text box arrow, and then click Table: Products.
5 To move an available field of the Products table to the Selected Fields pane, in the Available Fields list, click ProductName, and then click the > button.
6 To move to the next step, click Next.
7 The default selection to view data by Categories, and the checked option Form with subform(s) are fine. To move to the next step, click Next.
8 The default selection Datasheet of the layout of the subform is fine. To proceed to the next step, click Next.
9 To select a style for the form, in the Form Wizard, click Sumi Painting, and then click Next.
10 To assign a new title to the form, in the Form textbox, type Garden Products.
11 To assign a new title to the subform, press the TAB key, and then, in the Subform text box, type Indoor Products Subform.
12 To accept the default option of Open the form to view or enter information, and to finish creating the form and the subform, click Finish.
13 To view the list of all the products in one category, in the subform Indoor Products, point to the scroll box, press and hold down the mouse button, drag the mouse button to near the end of the scroll bar, and then release the mouse button.
14 To view the next Category Name record, in the Garden Products form window, on the navigation bar at the bottom, click the Next Record (right arrow) button.
15 To close the Garden Products form, in the upper-right corner of the window, click the lower of the two Close buttons.