Microsoft Office Tutorials and References
In Depth Information
Making Controls That Display Text, Numbers, and Dates
source for the form. If a form’s record source is the Customer List table in
the database for a business, one text box may have the ID field as its
control source; the text box displays the contents of the ID field in the current
record of the Customer List table.
A control’s name usually is the same as its control source, but not always. You
can have a text box named TextBox123 for which the control source is the
Selling Price field in the Products table, for example. Giving your controls
the same names as the fields that they display is good practice, though, and
cuts down on confusion. When you drag a field from the field list to the form,
Access usually names the new control after the field that it displays.
Making Controls That Display
Text, Numbers, and Dates
Face it: The most important information on most forms and reports is text.
Pictures are interesting, but text (including numbers and dates, which can
be displayed as text) usually is the heart of the matter. Access has several
types of controls that display text on forms and reports, including the
✦ Label controls: Display fixed text — text that isn’t based on the record
that you’re displaying on the form
✦ Text box controls: Display information from fields in the record source
of the form, or calculated information
✦ List box and combo box controls: Display drop-down menus of values,
usually for a field in the record source
This section describes how to create and format labels and text boxes. For a
discussion of combo boxes, list boxes, and option buttons (radio buttons),
see Chapter 3 of this minibook.
Making and editing labels
Every form has a title on its object tab, which you can set by editing the
Caption property of the form (as described in Chapter 1 of this minibook).
But you may want some other titles on the form, including explanations of
how to use the forms, headings for different sections of the form, and labels
that apply to the controls for specific fields. (Labels are unbound fields; they
don’t take their information from a table.)
For reports, you use labels wherever you want to display text that doesn’t
come from the record source, such as the report title, the date, instructions,
or any other text that’s not stored in a table. (For more formatting options
that are available for reports, see Book V, Chapter 1.)