Tài liệu Microsoft Office Access 2007 P2 - Pdf 86

7.
If you want to use the form right away, leave the Open the Form to View or Enter
Information option activated. Alternatively, click M
odify the Form’s Design to open
the form in Design view (see “Creating a Form in Design View,” later in this chapter).
8.
Click F
inish to complete the form.
This is the end of the Form Wizard. You can create a sophisticated and professional data
entry form in a fraction of the time needed to create the form from scratch. The wizard
isn’t as fast as the Form, Split Form, and Multiple Items commands, but it does allow a bit
more flexibility in the customization.
Navigating a Form
Navigation in a form refers not just to the fields that appear on the form but also to the
records within the form. When you’re working on a form, you can navigate the form using
several methods. The first is to use the Enter key. The Enter key accepts the data that the
user entered into the field and moves the focus to the next field. The Tab key performs the
same action, but the user doesn’t need to enter any data. If shortcut keys are associated with
buttons on the form, the user can hold down the Alt key and press the corresponding
underlined letter. For moving between records, the easiest technique is to use the record
navigation buttons that appear at the bottom of the form.

To learn how to specify shortcut keys for form controls, see“Using Labels to Create Keyboard Shortcuts for Controls,”p. 42.(Chapter 2)
Otherwise, to navigate fields and records in a form, you can use the keys outlined in
Table 1.1.
Table 1.1 Keys to Use When Navigating Fields and Records in a Form
Key Description
Tab or right arrow Moves to the next field to the right; from the last field, moves down to
the first field in the next record.
Shift+Tab or left arrow Moves to the previous field to the left; from the last field, moves up to
the first field in the previous record.

If the form is already open, choose Home, click the lower half of the View split button,
and then click D
esign View. (Alternatively, click the Design View button on the status
bar; see Figure 1.8.)
To start a new form, you have two choices:

Choose Create, Blank Form. Then choose Format, click the lower half of the View
split button, and then click D
esign View.

Choose Create, Form Design.
When you create a new form, it isn’t associated with a table or query, so you need to set the
record source by hand. See “Changing the Record Source,” next.
Figure 1.8 shows a new, blank form in Design view. Note that you place the form controls,
including the table’s fields and their labels, in the Detail area.
Changing the Record Source
The fields available to the form depend on the table or query that you’ve defined as the
form’s record source. If you’ve created a blank form, you need to specify the record source
yourself. For an existing form, you might want to change the record source to a different
table or query. Either way, you follow these steps to change the record source while you’re
in Design view:
1
1.
Select the form by clicking the form selector button (pointed out in Figure 1.8).
2.
Choose Design, Property Sheet. The Property Sheet pane appears.
3.
Click the Data tab.
4.
Pull down the Record Source list and then click the table or query you want to associ-

Creating a Form in Design View
change these properties on the form by using the control’s property sheet, which you dis-
play as follows:

Click the control (the data control, not the associated label) and then choose Design,
Property Sheet (or press Alt+Enter).

Right-click the control and then click Properties.
See “Adding Fields to the Form,” later in this chapter, to learn how to add a bound control
to the form.
Unbound Controls
An unbound control is used to convey information to the user or to receive from the user
input that won’t be stored in the underlying record source. In other words, unbound means
that the control isn’t associated with (bound to) any field.
Here are some examples of using unbound controls:

A label for a text box that describes what the text box represents.

Text boxes or drop-down list boxes that can be used to select different scenarios on a
what-if form.

A line used to separate different sections of the form.

A company logo or other graphical effects.
When you add a control to a form when the Control Wizard is activated, the control is
automatically unbound.

To learn about adding unbound controls and using the Control Wizard, see“Inserting Controls on a Form,” p. 30.(Chapter 2)
Calculated Controls
Calculated controls use expressions to derive their data. Expressions are combinations of

erty for the field to which the control is bound.
1
Chapter 1 Creating and Using a Form
18
Figure 1.9
Some fields from the
Products table added to
the form.
Fields
Form View
Labels
Changing the Size of the Form
If you find that your form is either too small to hold all the fields or has too much empty
space, you can change the size of the form as follows:

To adjust the form’s height, move the mouse pointer to the bottom edge of the Detail
area. Click and drag the edge of the form down (to make the form bigger) or up (to
make the form smaller).

To adjust the form’s width, move the mouse pointer to the right edge of the Detail
area. Click and drag the edge of the form right (to make the form wider) or left (to
make the form thinner).
Viewing the Form
After you’ve added at least one field, you can display the underlying record source in the
form by switching to Form view. You have two choices:
19
Creating a Form in Design View

Choose Design and then click the top half of the View split button.


NOTE
Note, too, that you can customize these AutoFormats to suit your taste. In the AutoFormat
dialog box, click the C
ustomize button to display the Customize AutoFormat dialog box
that has three options:

Create a New AutoFormat Based on the Form ‘Form’—Choose this option to cre-
ate a new AutoFormat template based on the formatting used in the current form.

Update AutoFormat with Values from the Form ‘Form’—Choose this option to
change the currently selected AutoFormat template based on the formatting used in the
current form.

Delete AutoFormat—Choose this option to delete the currently selected AutoFormat
template.
Working with Form Properties
Any form object comes with a large number of properties that you can work with. Many of
these are obscure and can be safely ignored, but there are a few that you might find useful.
To work with the form properties, follow these steps:
1.
Select the form by clicking the form selector button, pointed out earlier in Figure 1.8.
2.
Choose Design, Property Sheet (or press Alt+Enter) to display the Property Sheet
pane.
3.
Modify the properties you want to work with.
1
Chapter 1 Creating and Using a Form
20
If you’re not sure what a property does, click inside the property and then press F1. Access loads the

Page Footer—This section appears at the bottom of each printed page.
To display the Page Header and Page Footer, choose the Arrange tab and then click the
Page Header/Footer button in the Show/Hide group.
Figure 1.11 shows a form with the four header and footer sections added. Note that if you
need to select a section (to format it, for example), you can do so by using either of the fol-
lowing techniques:

Click the separator bar above the section you want to work with.

Choose Design, Property Sheet and then use the Object list in the Property Sheet
pane (pointed out in Figure 1.11) to choose the section you want.
Figure 1.12 shows the Form view, which displays the Form Header and Form Footer
sections.
1
To change the height of any section, move the mouse pointer to the bottom edge of the section.
Then click and drag up or down to resize the section.
NOTE


Nhờ tải bản gốc
Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status