Microsoft Office Tutorials and References
In Depth Information
The Record Source property is set to an SQL SELECT statement. You need to
change the Record Source property to a table or query, or the Combo Box Wizard
will not present you with the option to find records in a form. You’ll change the
Record Source property to the tblContract table, because this table is the record
source for all the bound controls you added to the Detail section.
3. Click the Record Source text box, press the F2 key to select the entire property
setting, type tblContract , and then close the property sheet.
You’ll now use the Combo Box Wizard to add a combo box to the form’s Form
Header section to find a record in the tblContract table to display in the form.
4. In the Controls group on the Design tab, click the Combo Box button (with the
ScreenTip “Combo Box (Form Control)”), position the + portion of the pointer at the
top of the Form Header section and at the 5-inch mark on the horizontal ruler (see
Figure 6-33), and then click the mouse button. Access places a combo box control
in the form and opens the first Combo Box Wizard dialog box.
The dialog box now displays a third option to “Find a record on my form based on
the value I selected in my combo box,” which you’ll use for this combo box. You
choose the first option, which you used for the CustomerID combo box, when you
want to select a value from a list of foreign key values from an existing table or
query. You choose the second option when you want users to select a value from a
short fixed list of values that don’t change. For example, if Belmont Landscapes
wanted to include a field in the tblCustomer table to classify each customer, you
could use a combo box with this second option to display a list of values such as
Residential, Commercial, Nonprofit, and Government.
5. Click the Find a record on my form based on the value I selected in my
combo box option button, and then click the Next button to open the next dialog
box. This dialog box lets you select the fields from the tblContract table to appear
as columns in the combo box. You’ll select the first field.
6. Double-click ContractNum to move this field to the Selected Fields list box, and
then click the Next button.
7. The column is already resized properly, so click the Next button.
In this dialog box, you specify the name for the combo box’s label. You’ll use Select
Contract as the label.
8. Type Select Contract , and then click the Finish button. The completed unbound
combo box is displayed in the form. See Figure 6-34.
Unbound combo box added to the form