Chapter 7: Creating Basic Access Forms
285
Some properties have a list of standard values such as Yes or No; others display varying lists of
fields, forms, reports, or macros. The properties of each object are determined by the control itself
and what the control is used for.
A nice feature in Access is the ability to cycle through property choices by repeatedly double-clicking
on the choice. For example, double-clicking on the Display When property alternately selects
Always, Print Only, and Screen Only.
The Builder button contains an ellipsis (...) and opens one of the many builders in Access —
including the Macro Builder, the Expression Builder, and the Module Builder. When you open a
builder and make some selections, the property is filled in for you. You’ll learn about builders later
in this book.
Each type of object has its own property window and properties. These include the form itself,
each of the form sections, and each of the form’s controls. You display each of the property win-
dows by clicking on the object first. The property window will instantly change to show the prop-
erties for the selected object.
Naming control labels and their captions
You might notice that each of the data fields has a label control and a text-box control. Normally,
the label’s Caption property is the same as the text box’s Name property. The text box’s Name
property is usually the same as the table’s field name — shown in the Control Source property.
Sometimes, the label’s Caption is different because a value was entered into the Caption prop-
erty for each field in the table.
When creating controls on a form, it’s a good idea to use standard naming conventions when set-
ting the control’s Name property. Name each control with a prefix followed by a meaningful name
that you’ll recognize later (for example, txtTotalCost, cboState, lblTitle). Table 7.2
shows the naming conventions for form and report controls. You can find a very complete, well-
established naming convention online at http://www.xoc.net/standards.
The properties displayed in Figure 7.27 are the specific properties for the Description text box. The
first two properties, Name and Control Source, are set to Description.
The Name is simply the name of the field itself. When a control is bound to a field, Access auto-
matically assigns the Name property to the bound field’s name. Unbound controls are given names
such as Field11 or Button13. However, you can give the control any name you want.
With bound controls, the Control Source property is the name of the table field to which the
control is bound. In this example, Description refers to the field with the same name in tblProd-
ucts. An unbound control has no control source, whereas the control source of a calculated con-
trol is the actual expression for the calculation, as in the example =[SalePrice] - [Cost].