Core Training for Microsoft Office Access 2003

Simplifying Data Entry with Forms

Creating and Exploring Forms

1To start creating a form using the Form Wizard, on the Objects bar, click Forms.
2In the Database window, double-click Create form by using wizard.
3To base the form on the table or query listed in the Tables/Queries box, in this case, the Customers table, and select all the available fields in the Customers table, click the >> button, and then click Next.
4To apply the default Columnar field layout for the new form, click Next.
5To select a style for the form and controls, click the Sumi Painting style in the list, and then click Next.
6To accept the suggested name, Customers, and create the form, make sure that the Open the form to view or enter information option is selected, and then click Finish.
7To move sequentially through the fields in the Address field, press the TAB key three times.
8To move to the next record, on the Navigation bar, click the Next Record button, as indicated.
9To view the last record, on the Navigation bar, click the Last Record button, as indicated.
10To view the same record in Datasheet view, on the Form View toolbar, click the View arrow, and then click Datasheet View.
11To scroll to see previous records, click once above the scroll box in the scroll bar.
12To move to the previous record, press the UP ARROW key.
13To move to the Customer ID field for the current record, press the HOME key.
14To move to record 50 in the form, double-click the indicated Active record box, and then, for the purposes of this exercise, press SPACEBAR to have the number 50 entered for you, and then press ENTER.
15To set the width of the FirstName column to the width of its widest entry, double-click the column separator between the FirstName and LastName column headers.
16To set the width of the LastName column to the width of its widest entry, double-click the column separator between the LastName and the Address column headers.

Creating a Form Using AutoForm

1To create a new form by using AutoForm, on the Database window toolbar, click New, and then click AutoForm: Columnar.
2To specify a table on which to base the form, click the list arrow, click Employees, and then click OK.
3To save the form, click the File menu, click Save, in the Save As dialog box, accept the default name Employees, and then click OK.
4To switch to Design view, click the View menu, and then click Design View.
5To select a field, in the Detail section of the Employees: Form window, click the EmployeeID text box.
6To edit the field properties, click the View menu, and then click Properties.
7To set a field property value, in the Text Box: EmployeeID window, click the Data tab.
8To disable the EmployeeID field, click the Enabled text box, click the Enabled arrow, and then, in the list, click No.
9To close the Text Box: EmployeeID window, on the title bar, click the Close button.
10To select the Employees form, click the form selector, as indicated.
11To switch to Form view, click the View menu, and then click Form View.
12To switch to Design view, click the View menu, and then click Design View.
13To edit the form properties, click the View menu, and then click Properties.
14To remove the form scroll bars, in the Form properties window, click the Format tab, click the Scroll Bars box, click the list arrow, and then in the list, click Neither.
15To remove the form record selector, click the Record Selectors box, click the list arrow, and then click No.
16To close the Form properties window, on the title bar, click the Close button.
17To switch to Form view, click the View menu, and then click Form View.
18To close the Employees form, click the File menu, and then click Close.
19To save the changes made to the form, in the Microsoft Office Access message box, click Yes.
20To delete the Employees form, click Employees, press DELETE, and then in the Microsoft Office Access message box, click Yes.

Refining Form Properties

1To open the Customers form in Design view and begin refining its properties, in the GardenCo: Database window, click Customers, and then click the Design button on the Form Design toolbar.
2To expand the form, click the Maximize button on the title bar of the form.
3To change the font of a label, click the CustomerID label, click the Font arrow, as indicated, on the Formatting toolbar, and then click Microsoft Sans Serif in the Font list.
4To make the font slightly smaller, click the Font Size arrow, as indicated, on the Formatting toolbar, and then click 8 in the Font Size list.
5To change the properties assigned to the text box, click the CustomerID text box, click the View menu, and then click Properties.
6To change the font used in the text box, in the Text Box: CustomerID Properties dialog box, on the Format tab, click the Font Name box, click the Font name arrow, and then click Microsoft Sans Serif in the Font Name list.
7To make the font smaller, click the Font Size box, click the Font Size arrow, and then click 8.
8To select all of the controls in the form at the same time so you can change the font for all of them at once, click the Edit menu, and then click Select All.
9To change the font for all of the selected controls, on the Formatting toolbar, click the Font arrow, and then click Microsoft Sans Serif in the Font list.
10To change the background color of the controls, in the Multiple selection Properties dialog box, click the Back Style box, click the Back Style arrow, and then click Normal.
11To change the background color of the selected controls, click Back Color, click the button, and then, in the Color dialog box, click the indicated square, click OK, and then press ENTER.
12To add a shadow effect to the selected controls, click the Special Effect arrow, and then click Shadowed in the list.
13To change the color of the border, click Border Color, click the button, and then, in the Color dialog box, click the indicated green square, click OK, and then press ENTER.
14To cancel the selection of the controls and select the entire form, click the Form selector, as indicated.
15To remove the background color that was set when you created the form, in the Form Properties dialog box, in the Picture box, click to the right of the word (bitmap), drag left to select the text, and then press the DELETE key.
16To confirm the deletion, press ENTER, and then click Yes.
17To cancel the selection of the Form section and select the Detail section, click the Detail selector, as indicated.
18To set the background color for the Detail section, in the Section: Detail Properties dialog box, click the Back Color box, click the button, and then, in the Color dialog box, click the indicated color, and click OK.
19To change the caption for the FirstName label, click the FirstName label, and in the Label: FirstName_Label Properties dialog box, in the Caption box, drag from left to right to select First, and then press DELETE.
20To remove the LastName label, click the LastName label control, and then press DELETE.
21To select two of the existing form labels, click the CustomerID label, press and hold down the SHIFT key, and then click the Name label.
22To right-align the selected labels, in the Multiple selection Properties dialog box, click once below the scroll box on the scroll bar, click the Text Align box, click the Text Align arrow, and then click Right in the list.
23To resize the selected labels to fit their contents, click the Format menu, point to Size, and then click To Fit.
24To clear the selection of the label controls, click a blank area of the form below the Address text box control.
25To select all of the text boxes but not the corresponding labels, click a blank area in the lower right corner of the form, as indicated, and drag up and to the left to the CustomerID text box.
26To insert space between the selected controls, in the Multiple selection Properties dialog box, click once above the scroll box on the scroll bar, drag from left to right to select the contents of the Left box, press SPACEBAR, to have 1.5 entered for you, and then press ENTER.
27To change the weight of the font for the selected controls, click once below the scroll box on the scroll bar, click the Font Weight box, click the Font Weight arrow, and then click Normal.
28To close the Properties dialog box and save your changes, on the Multiple selection Properties dialog box, click the Close button, and then on the Form Design toolbar, click the Save button.
29To view the new form in Form view, on the Database toolbar, click the View button.

Refining Form Layout

1To open the Customers form in Design view, on the Database toolbar, click the Design button.
2To resize the FirstName text box, click it, move the pointer to the right edge of the text box until the pointer shape changes to a horizontal arrow, and then drag the right edge of the control to the indicated location.
3To reposition a text box, click the LastName text box, move the pointer over it, and when the pointer shape changes to a hand, drag the text box to the right of the FirstName text box, as indicated.
4To move both a text box and its label control, click the Address text box, move the pointer over the selected controls, and when the pointer shape changes to a hand, drag them to the indicated location.
5To begin creating and saving a style based on the active form so that you can apply it to other new or existing forms, click the Format menu, and then click AutoFormat.
6To create an AutoFormat based on the new Customers form, click the Customize button, click Create a new AutoFormat based on the Form 'Customers' option, and then click OK.
7To give the new style a name, for the purposes of this exercise, press SPACEBAR to have the style name entered for you, and then click OK.
8Notice that the new style now appears in the Form AutoFormats list, and then click OK to close the AutoFormat dialog box.
9To remove the grids from the form, click the View menu, and then click Grid.
10To save the changes you made to the form, click the Save button on the Form Design toolbar.
11To view the form in Form view, click the View button on the Form Design toolbar.

Adding Controls to a Form

1To open the Customers form in Design view, on the Database toolbar, click the Design button.
2To increase the size of the form header, point to the line between the Form Header selector and the Detail selector, and drag the line down one inch, as indicated.
3To display the Toolbox, click the View menu, and then click Toolbox.
4To start adding an image to the form header, click the Image control, as indicated.
5To draw the image control on the form, point to the upper-left corner of the Form Header section, drag to the right three inches and down one inch, as indicated.
6To insert the Garden Company logo, in the Insert Picture dialog box, double-click Garden Company, double-click Artwork, click tgclogo, and then click OK.
7To add a label to display a heading, in the Toolbox, click the Label button, and then in the Form Header section, to the right of the logo, drag from the top left corner of the indicated area to the bottom right corner of the indicated area, to draw a label control box.
8To add a caption to the new label control, for the purposes of this exercise, press SPACEBAR, to have the text Customers entered for you, and then press ENTER.
9To adjust the size of the font in the label, click the View menu, and then click Properties.
10On the Format tab of the Label: Label21 dialog box, click the Font Size box, click the Font Size arrow, and then click 18 in the list.
11To center the text in the label and then close the Label: Label21 dialog box, click the Text Align box, click the Text Align arrow, click Center, and then click the Close button on the title bar of the dialog box.
12To adjust the size of the label to fit its contents, click the Format menu, point to Size, and then click To Fit.
13To insert a combo box below the Country text box, in the Toolbox, click the indicated Combo Box control, and then drag from the top left corner of the indicated area to the bottom right corner of the indicated area, to draw a combo box.
14To copy and apply the formatting of the Country text box to the new combo box, click the Country text box, click the Format Painter button, as indicated, and then click the combo box.
15To set the source of data for the combo box, click the Unbound combo box, click the View menu, click Properties, and then in the Combo Box: Combo 24 dialog box, click the Data tab.
16In the Control Source box, click the Control Source arrow, click Country in the list, and then press ENTER.
17To have the data entered in the combo box for you, click the Row Source box, click the Row Source arrow, press SPACEBAR, and then press ENTER.
18To start changing the combo box label caption, click the combo box label, and in the Label: Label25 dialog box, click the Format tab.
19To have the new caption text entered for you, press the SPACEBAR, and then press ENTER.
20To resize the Country label, click the Format menu, point to Size, and then click To Fit.
21To delete the original Country text box and its label, in the Detail section, click the original Country text box, and then press the DELETE key.
22To move the new combo box, drag the Country combo box and its associated label to where the original Country text box was, as indicated.
23To close the Combo Box: Combo 24 dialog box, click the Close button. Then, to close the Toolbox, in the title bar of the Toolbox window, click the Close button.
24To save the form and view it in Form view, click the Save button on the Form Design toolbar, and then click the View button on the Form Design toolbar.
25To use the combo box, on the Navigation bar, click the Next Record button once, click the Country box arrow, and then click USA in the list.
26To undo the last change, on the Formatting toolbar, click the Undo button.
27To return to Design view and make a few more adjustments to the form, click the View button, and then double-click the Form selector.
28To remove the indicated record selector, on the Format tab, double-click in the Record Selectors box.
29To remove the scroll bars, double-click Scroll Bars box, and then click the Close button on the title bar of the Form dialog box.
30To save and view the form's new design, click the Save button on the Form Design toolbar, and then click the View button on the Form Design toolbar.

Adding a Subform to a Form

1To define relationships, click the Tools menu, and then click Relationships.
2To select the tables, in the Show Table dialog box, notice that the Categories table is selected by default, click Add, click Products, and then click Add.
3To close the Show Table dialog box, click Close.
4To relate the common fields, in the Categories table field list, drag the CategoryID field to the CategoryID field in the Products table field list, as indicated.
5To enforce referential integrity, in the Edit Relationships dialog box, click the Enforce Referential Integrity check box.
6To enable cascade update and cascade delete, click the Cascade Update Related Fields check box, click the Cascade Delete Related Records check box, and then click Create.
7To close the Relationships window, click the File menu, and then click Close.
8To save the relationship, in the Microsoft Office Access message box, click Yes.
9To open the Categories form in Design view, click Categories, and then on the Database window toolbar, click Design.
10To increase the size of the form Detail section, in the Categories: Form window, drag the indicated Form Footer section selector down to the 3 ½ inch mark on the vertical ruler.
11To insert a subform control, in the Toolbox, click the indicated Subform/Subreport button, click the indicated left area of the Detail section, and, to draw a rectangle, move the mouse diagonally to the indicated right area.
12To use existing tables and queries for the subform, in the Subform Wizard, click Next.
13To specify a table for the subform, click the Tables/Queries list arrow, and then click Tables: Products.
14To include fields on the subform, under Available Fields, click ProductName, and then click the > button.
15To confirm the fields on the subform, click Next.
16To use the CategoryID field to link the form and the subform, click Next.
17To complete the subform creation process, click Finish.
18To maximize the Categories form window, on the form window title bar, click the Maximize button.
19To switch to Form view, click the View menu, and then click Form View.
20To display the list of categories, in the subform, click in the Category box of the first record, and then click the Category list arrow.
21To change the category, in the Category list, click Cacti.
22To close the form window, on the title bar of the form window, click the Close button, and to save the changes, in the Microsoft Office Access message box, click Yes.