Chapter 7

A Form for All Reasons

In This Chapter

arrow Creating forms the easy way with Form tools

arrow Building a form with the Form Wizard

arrow Adding the finishing touches

Access forms are similar to paper forms in their function — they’re used in part to collect data — but Access forms go beyond paper forms by having a direct connection to the database tables that store the collected information. In the “old days,” after you completed a paper form, some poor soul had to manually organize and file each form in a file cabinet or tabulate results by hand. With the advent of electronic databases such as Access, the data typed into an electronic form is simultaneously placed in the file cabinet (the table) connected to that form.

Like reports and queries, forms are named and stored in the database file. Forms are full-fledged Access objects, so you can customize them easily to meet the needs of your business.

This chapter shows what forms can do for you, shows you how to make forms, and provides tips for customizing forms so they’re exactly what you need.

Generating Forms

Depending on your needs, you can create forms in three ways:

check.png The Form tools make attractive forms with a click of the mouse.

check.png The Form Wizard asks some questions and then creates an attractive form based on your answers.

check.png The Form Design and Blank Form buttons let you start with a blank form and build from the ground up.



technicalstuff.eps The Form tools and the Form Wizard make it easy to create a form. I focus on using these two methods to build forms. Building forms from scratch in Design or Layout view is beyond the scope of this book.

The Form Wizard and Form tools are a time-saving gift from your friends at Microsoft. Use them to create your forms. They do the hard stuff so all you have to do is provide the finishing touches.

tip.eps Use these criteria to determine which form-building tool to use:

check.png Use the Form tools if

• You want all fields in the selected table or query to appear on the report.

• You don’t want control over the type of style that is applied to the form.

check.png Use the Form Wizard (covered later in this chapter) if

• You want to select specific fields for your form.

• You want to select fields from more than one table or query.

• You want choose from a list of layouts for your form.

Keeping it simple: Form tools

I have good and bad news about these tools:

check.png Good news: They’re fast, and they don’t ask any questions or talk back!

check.png Bad news: They’re extremely inflexible buggers.

You want a larger font and a different background color? Keep it to yourself. The Form tools decide what font, colors, and layout you get.

tip.eps After you create a form with a Form tool, you can modify the form. In this chapter, the Customizing Form Parts section gives you the straight scoop.



To create a form using one of the Forms buttons, open your database and follow these steps:

1. From the Navigation pane, select the table or query that contains the data your new form should display.

2. Click the Create tab on the Ribbon.

Several button groups appear on the Ribbon, including the Forms group. (See Figure 7-1.)

9781118568507-fg0701.eps

Figure 7-1: The Create tab of the Ribbon holds the Forms buttons.

3. Click the form button of your choice from the Forms buttons.

The Simple Form button is labeled Form. The Multiple Items and Split Form buttons are on the More Forms drop-down list.

tip.eps The sidebar Meet the Form tools shows the best Form tool for your data.

A beautiful form appears before your eyes (and in Figure 7-2)!

4. To finish your form, follow these steps:

a. Click the Save button on the Quick Access toolbar.

The Save As dialog box appears.

b. Type a name for the form in the dialog box, and click OK.

Your form name appears on the Navigation pane.

Granting most wishes: the Form Wizard

When you want to control field selection and the style of form design, use the Form Wizard.

9781118568507-fg0702.tif

Figure 7-2: Form based on the Customers table using the Split Form button.

As with all Access wizards, the Form Wizard steps you through the creation process. To use the Form Wizard, follow these steps:

1. Open your database file.

2. Click the Create tab on the Ribbon.

Several button groups appear on the Ribbon, including the Forms group.

3. Click the Form Wizard button. (Refer to Figure 7-1.)

The Form Wizard springs into action, as shown in Figure 7-3.

4. Using the Tables/Queries drop-down menu, select the source of the form’s fields:

a. Click the down arrow to list the database’s tables and queries.

b. Select the table or query that contains the fields you want to view with this form.

The Form Wizard lists the available fields.

5. Select the fields you want.

• To select individual fields, double-click each field you want in the Available Fields list. (Again, see Figure 7-3.)

• If you want to add all the fields from your table or query to your form, click the >> button in the middle of the screen.

tip.eps Feel free to select fields from different tables, provided the tables are related properly. The wizard will not let you select fields from unrelated tables.

9781118568507-fg0703.eps

Figure 7-3: Select the data source and fields you want to see on the form.

tip.eps To remove a field that you accidentally chose, double-click its name in the Selected Fields list. The field jumps back to the Available Fields side of the dialog box.

6. After you’ve selected all the fields you want to include on your form, click Next.

technicalstuff.eps If you selected fields from more than one table, the Form Wizard takes a moment to ask how you want to organize the data in your form. If you choose to organize your data by the parent table (Chapter 4 shows how), you’ll be asked to show the child table data as either

Subform: Shows data from both tables on one form.

Linked form: Creates a button that, when clicked, will take you to a new form that displays the child table data.

7. When the wizard asks about the form layout, choose one of the following layouts and then click Next:

Columnar: Records are shown one at a time.

Tabular: Multiple records are shown at the same time with an attractive style applied to the form.

Datasheet: Multiple records are shown at the same time in a rather unattractive spreadsheet-like way.

Justified: Arranges the fields on the form in a tidy block of rows that have pronounced left and right margins.

tip.eps Don’t know which layout is best? Check out the Giving forms the right look sidebar.

8. Enter a descriptive title in the What Title Do You Want for Your Form? box at the top of the Form Wizard screen.

tip.eps There are good reasons to give your form a descriptive title instead of the default name (which is the name of the data source):

• Tables and forms that share the same name can become confusing.

• The name you type is used to save your form. Letters and numbers are allowed in form names. It’s a great opportunity to impose some order.

9. Click Finish to open the report in print preview.

Your new form appears onscreen, as shown in Figure 7-4.

The Form Wizard automatically saves the form as part of the creation process. You don’t need to manually save and name it. All saved forms display in the Forms section of the Navigation pane.

9781118568507-fg0704.tif

Figure 7-4: Lookin’ good. A form created by the Form Wizard.


tip.eps The rest of this chapter shows how to customize forms you’ve created with the Form Wizard and Form tools.

Customizing Form Parts

The Access 2013 Form tools and Form Wizard do a great job building forms. In fact, for the typical user, they do just about everything — but they don’t always do it all. So you may need to do some form-tweaking.

If you know some form-design basics, you can clean up most of the problems left behind by the Form tools and Form Wizard.

The rest of this chapter shows how to change the overall look of the form. In particular, you get a handle on moving, sizing, labeling, and formatting controls on your forms. (A control is any design element on a form — say, a line, label, or data-entry box — that affects the appearance of the form. More about that later in the chapter.)

Taking the Layout view

You can make form-design changes in either Design or Layout view.

tip.eps The sidebar A form with a view explains these views.

These instructions concentrate on Layout view because it’s easier to use.

To enter Layout view, follow these steps:

1. On the Navigation pane, right-click the form you’d like to modify.

The shortcut menu appears.

2. Select Layout View from the shortcut menu.



tip.eps How can you tell whether you’re in Layout view or Form view? Look at the status bar in the lower-left corner of your screen. It tells you the current view for an open form.

The theme’s the thing

After building your new form with the Form Wizard or Form tools, you may not like the appearance that the tools have chosen for your form. Fear not! It’s easy to change the look of the form by using the Theme group of buttons. Here’s how:

1. From the Navigation pane, right-click the form that needs a new look and choose Layout View from the menu that appears.

The form opens in Layout view.

2. Click the Design tab on the Ribbon.

Several button groups appear on the Ribbon, including the Themes group. (See Figure 7-5.)

9781118568507-fg0705.eps

Figure 7-5: The Themes group on the Ribbon.

3. Click the Themes button.

An illustrated list (called a Gallery) of themes drops down.

4. Roll the mouse pointer slowly over each theme.

The form in the background changes to match the highlighted theme.

5. When you’ve found the theme you like, click it to select it from the drop-down list and apply it to the form.

tip.eps Choose a theme with fonts and colors that are easy on the eyes. Form users will thank you for it!

Managing form controls

A control is any design element (such as a line, label or data-entry text box) that appears on a form. The Form Wizard and Form tools do a fine job of constructing forms but often don’t place or size them just right. This section discusses how to take charge of your controls.

Control types

The two most common control types display data pulled from an underlying table or query (as with a text box) or supply a design element to keep the data organized on the form (as with a line).

Here are the most common form controls:

check.png Text box: The box where you type your data.

Text boxes are either bound (a way of saying linked) to a table field or unbound (containing a calculation derived from other fields in a table).

check.png Label: The descriptive text next to the text box or the title of the form.

check.png Combo box: A drop-down list of choices.

check.png List box: A box that contains a list of choices, from which the user can choose more than one item.

check.png Check box: A square box attached to a field that can store only true/false, on/off, or yes/no answers. For example, a personnel table may have a field called Married. Either you are or you aren’t.

check.png Subform: A form inside another form.

Subforms usually display the “many” records of the “one” record when tables are in a one-to-many relationship. (For details on table relationships, see Chapter 4.)

tip.eps If your form is columnar (most are) and you’ve created it with the Form Wizard or Form tools, all text boxes and labels on the form are anchored. Anchored controls behave as a group when you size them. Additionally, you can move anchored controls as long as they’re among the other controls in a group; you can’t move them if they’re outside the group.

Moving controls

To move a control, enter Layout view (as shown previously in this chapter) and then follow these steps:

1. Put the mouse pointer anywhere on the control that you want to move.

The mouse pointer changes to a four-headed arrow.

2. Hold down the left mouse button.

The control is selected, so a thick border appears around it. See Figure 7-6 for an example of a selected control.

tip.eps To select additional controls such as a label corresponding to a text box, press and hold the Ctrl key while clicking the additional control. A thick border will appear around all selected controls.

9781118568507-fg0706.eps

Figure 7-6: A selected control on the Customers form.

3. Drag the control to its new location.

A line follows the mouse pointer as you drag up, down, left, or right.

4. When the control is in position, release the mouse button.

The control drops smoothly into place.

tip.eps If you don’t like an adjustment you’ve made, press Ctrl+Z to undo the change and start over from scratch. Access has multiple undo levels, so play to your heart’s content; you can always undo any mistakes.

Sizing controls

Sometimes the Form Wizard and Form tools fall a bit short (literally) when they’re sizing your text boxes and labels. A common problem is that the last part of the information displayed in a label or text box is cut off.

To size a control, enter Layout view (as shown previously in this chapter) and then follow these steps:

1. Put the mouse pointer on the control that you want to size.

The mouse pointer changes to a four-headed arrow. If the controls are anchored, it doesn’t matter which control you roll the mouse pointer over.

2. Click to select the control.

A thick border appears around the control to indicate that the control is selected.

3. Move the mouse pointer to the edge of the selected control.

A double-arrow pointer shape appears.

4. Click and drag to resize the control.

technicalstuff.eps Anchored controls size together horizontally within the same column and vertically within the same row. So when you change the width of one control in a column, all are changed to that same width. When you change the height of one control in a row, all in that row are changed to the same height.

Editing labels

The Form Wizard and Form tools use field names as control labels when they build your forms. If you abbreviated a field name (say, FName for First Name) when creating a table, that abbreviation will become the label for the control created by the Form Wizard and Form tools. So, if a label doesn’t quite say what it should, you’ll need to know how to edit the text in it.

To edit a label, enter Layout view (as shown previously in this chapter) and try this:

1. Put the mouse pointer anywhere on the label that you want to edit.

The mouse pointer changes to a four-headed arrow.

2. Click to select the label control.

A thick border indicates that the control is selected.

3. Click the word you’d like to edit.

A blinking cursor appears on the word.

4. Edit the word.

5. Click outside of the label control.

The label is deselected and the edit is preserved.

Deleting controls

Sometimes an Access form contains an unneeded or unwanted control:

check.png Maybe you selected an unwanted field while using the Form Wizard.

check.png Maybe you added a control (such as a line) and in retrospect decided it wasn’t needed.

check.png Maybe you’re just tired of looking at that control.

Here’s how you remove the control:

1. In Layout view, put the mouse pointer anywhere on the control that you want to delete.

The arrow mouse pointer changes to a four-headed arrow.

2. Click to select the control.

A thick border appears around the control, indicating that it is selected.

3. Tap the Delete key on your keyboard.

The unwanted control disappears into digital oblivion.

technicalstuff.eps When you delete a text box, its corresponding label will also be deleted. When you delete a label, however, its corresponding text box (if there is one) won’t be deleted. Go figure!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset