MS Access

Creating a Form with AutoForm

To Create a Form with AutoForm: From the Database window, click the Forms icon in the Objects bar and click the New button. Select the type of form you want to create: Columnar, Tabular, Datasheet, PivotTable, or PivotChart. Click the table or query you want to use for the form from the drop-down list and Click OK.

Modifying a Form

To Modify a Form: From the Database window, click the Forms icon in the Objects bar, click the form you want to modify and click Design, or open the form and click the View button on the toolbar.

Adding and Deleting Fields

To Add a Field to a Form: Display the form in Design View and click the Field List button on the toolbar if necessary, find the field you want to add to the form in the Field List, then click and drag the field to the desired location on the form.

To Delete a Field or Control: Click the field or control to select it and then press Delete.

Moving and Sizing Controls

To Resize a Control: Click the control to select it, grab one of its sizing handles, drag and then release the mouse button when the control reaches the desired size. Hold down the Shift key while dragging to maintain the control's proportions while resizing it.

To Move a Control: Click the control and hold down the mouse button, drag the control to a new location and then release the mouse button to drop the control.

To Move a Text Box or Text Label Independently of Each Other: Position the pointer over the upper left sizing handle of the control until it changes to the hand icon, then click and drag the control.

Changing the Tab Order

To Change a Form's Tab Order: Display the form in Design View and select View » Tab Order from the menu. Click the row selector for the control you want to move and click and drag the row selector to the desired location. Repeat as needed to change the tab order of additional controls.

To Automatically Change the Tab Order: Display the form in Design View and select View » Tab Order from the menu. Click the Auto Order button to automatically reorder the form controls, based on their position in the form.

Working with Control Properties

To Display the Properties for Any Control: Display the form in Design View and do any of the following:

  • Select the control and click the Properties button on the toolbar.

  • Right-click the control and select Properties from the shortcut menu.

  • Select the control and select View » Properties from the menu.

Working with Form Properties

To View and Change Form Properties: Display the form in Design View and double-click the Form Selector. Click the appropriate property tab and property box and make the desired changes.

Working with Multiple Controls

To Select Multiple Controls: Do any of following:

  • Press and hold down the Shift key as you click each control that you want to select.

  • Use the arrow pointer to draw a box around the control that you want to select.

  • If the controls are aligned along a horizontal or vertical line, click the horizontal or vertical ruler above or to the left of the controls.

Adding, Cutting, Copying, and Pasting Controls

To Add a Control: Click the Toolbox button on the toolbar if necessary, click the button on the Toolbox for the type of control you want to add, in the Form window, click and drag the pointer where you want the control to appear.

To Cut a Control: Select the control and:

  • Click the Cut button on the toolbar or...

  • Press Ctrl + X or...

  • Select Edit » Cut from the menu.

To Copy a Control: Select the control and:

  • Click the Copy button on the toolbar or...

  • Press Ctrl + C or...

  • Select Edit » Copy from the menu.

To Paste a Control: Select the control and:

  • Click the Paste button on the toolbar or...

  • Press Ctrl + V or...

  • Select Edit » Paste from the menu.

Changing a Control's Data Source

To Change a Control's Data Source: Display the Form in Design View, select the control and click the Properties button on the toolbar, or right-click the control and select Properties from the shortcut menu, or select the control and select View » Properties from the menu. Click the Data tab, click the Control Source box, and then either click the arrow and select the field that you want to bind the control to or enter an expression. Close the Properties dialog box when you're finished.

Creating a Calculated Control

To Create a Calculated Control: Display the form in Design View, select the control and click the Properties button on the toolbar. Click the Data tab and click in the Control Source box, type the expression or use the Expression Builder to create the expression, and then close the Properties dialog box.

Changing a Control's Default Value

To Set a Control's Default Value: Display the form in Design View, display the properties for the desired control, and click the Data tab. Click the Default Value box and type the default value you want to appear for new records. Close the Properties dialog box when you're finished.

Using the Control Wizard

To Create a List Box or Combo Box: Display the form in Design View, click the Toolbox button on the toolbar if necessary and make sure the Control Wizards button on the Toolbox is selected. Click the Combo Box or List Box button on the Toolbox. In the form window, click and drag where you want the control to appear. Specify whether you want the control to get its values froma table or query, or if you want the control to find a record on the form. Select the table that contains the fields you want to include in the list, click Next, select the fields you want to appear in your list and click Next. Adjust the column widths if necessary, click Next. If necessary, specify which column contains the value that will be stored and click Next. Specify whether Access should merely display the value or display it in a field. Enter a label and click Finish.

Creating a Subform

To Create a Subform: Display the form in Design View, click the Toolbox button on the toolbar if necessary and make sure the Control Wizards button on the Toolbox is selected. Resize the form if necessary, then click the Subform/Subreport button on the Toolbox and click and drag where you want the subform to appear in the form. Click Next and specify the table or query you want to use for the subform and select the fields you want to appear in the subform. Click Next, specify the parent and child fields that link the main form and subform if necessary, and click Finish.

Modifying and Working with Subforms

To Modify a Subform: Click anywhere in the subform and edit the subform as needed.

To Display a Subform's Properties: Double-click the subform's Form Selector.

Quiz

  1. Which of the following statements about the AutoForm Wizard is NOT true?

    1. The AutoForm Wizard is the fastest and easiest way to create a form in Microsoft Access.

    2. The AutoForm Wizard can only create five types of forms: Datasheet, Columnar, Tabular, PivotTable, or PivotChart.

    3. Forms created with the AutoForm Wizard usually come out looking sharp and professional and don't require any further clean-up work.

    4. The AutoForm Wizard can only create forms based on a single table or query.

  2. Which of the following statements is NOT true?

    1. The Field List displays all the fields from a form's underlying table or query.

    2. Click the Field List button on the Toolbar to display the Field List.

    3. You can add fields to a form by dragging them from the Field List onto the form.

    4. The Field List displays all the fields from every table in a database.

  3. Controls and their corresponding text labels cannot be moved independently of one another. (True or False?)

  4. If you move a control on a form, the Tab Order, in which you advance from one field to the next when you press the Tab key, is automatically updated. (True or False?)

  5. A form that has a Datasheet Default View property would display one record at a time in the form. (True or False?)

  6. A calculated field... (Select all that apply.)

    1. ...is a bound control.

    2. ...is a control that contains an expression.

    3. ...can perform calculations on fields values, such as =[Cost]*[Commission].

    4. ...can perform calculations on explicit values, such as =2+4.

  7. Which of the following set(s) of tables would benefit from a subform? (Select all that apply.)

    1. A Customer table and the Customer Orders table.

    2. A Customer table and Products table.

    3. A Customer table and Foreign Currency table.

    4. A Customer table and a Customer Contacts table.

  8. When you add a subform to a main form, Access always recognizes how the two forms are related (True or False?)

Homework

  1. Open the Homework database.

  2. Use AutoForm to create and save a columnar form named "Customers," using the Customers table as the underlying data source.

  3. Add a text box control with today's date in the bottom-right corner of the Customers form.Hint: You will need to change the text box control's data source to the expression =Today( ).

  4. Rearrange the control fields on the form, so that the LastName and FirstName fields appear before the SSN field.

  5. Change the Customer form's tab order to reflect the new field order.

  6. Delete the DOB field control from the form.

  7. Resize the Customers form as necessary, then use the SubForm Wizard to create a subform based on the Insurance Claims table.

  8. Modify the Insurance Claims subform so that its Default View property is Single Form View.

  9. Save your changes to the main form and the subform. Then close the form and the Homework database.

Quiz Answers

  1. C. The AutoForm Wizard can create in record time, but they aren't usually well-organized or professional looking.

  2. D. The Field List only displays fields from a form's underlying table or query.

  3. False. You can click and drag the upper left sizing handle to move a label or control independently of one another.

  4. False. If you add or move a control on a form, you would have to change the form's tab order yourselfMicrosoft Access won't do it for you.

  5. False. A form whose Default View property was set to Datasheet would display multiple records. A form whose Default View property was set to Single Form would display one record on the form at a time.

  6. B, C, and D. All of these statements are true.

  7. A and D. Because subforms are great at displaying information from one-to-many relationships, both of these tables would benefit from being displayed in a subform.

  8. False. If you include the field that links the two tables, Access will automatically recognize it, if you have already joined the two tables. If the tables aren't related, you may have to manually join the tables by connecting their related fields.

by BrainBellupdated
Advertisement: