Add a list box or combo box (original) (raw)

When entering data on forms in Access desktop databases, it can be quicker and easier to select a value from a list than to remember a value to type. A list of choices also helps ensure that the value entered in a field is appropriate. A list control can connect to existing data, or it can display fixed values that you enter when you create the control. Read on to learn about the list controls available for Access forms, and how to create and customize them.

What do you want to do?

Learn about the types of list box controls

Access provides two list controls for forms — the list box and the combo box.

List box The list box control displays a list of values or choices. The list box contains rows of data, and is usually sized so that several rows are visible at all times. The rows can have one or more columns, which can appear with or without headings. If the list has more rows than can be displayed in the control, Access displays a scroll bar in the control. The user is limited to the choices given in the list box; it is not possible to type a value into a list box.

List Box

Combo box The combo box control provides a more compact way to present a list of choices; the list is hidden until you click the drop-down arrow. A combo box also gives you the ability to enter a value that is not in the list. In this way, the combo box control combines the features of a text box and a list box.

Using a combo box (drop-down list)

1. Click the arrow to display the drop-down list.

2. Click an option in the drop-down list.

List boxes and combo boxes can be bound or unbound controls. These controls can look up values in a fixed list that you type yourself, or they can look up values in a table or query. To create a bound list box or combo box that looks up values in a table or query, make sure the form is based on a record source that includes a foreign key field or Lookup field. This makes it possible to create the relationships that are needed to link the data in the list box or combo box to the data on the form.

Top of Page

Create a list box or a combo box by using a wizard

  1. Right-click the form in the Navigation Pane, and then click Design View.
    Note: This procedure assumes that the form is bound to a table or query. Some of the steps will not apply if the form is unbound. To determine if the form is bound to a table or query, press F4 to display the property sheet. On the Data tab of the property sheet, the Record Source property box displays the table or query that the form is bound to.
  2. On the Form Design tab, in the Controls group, ensure that Use Control Wizards is selected.
  3. Click either the List Box tool or the Combo Box Button image tool.
  4. On the form, click where you want to place the list box or combo box.
    • Depending on your choice, the List Box Wizard or the Combo Box Wizard starts.
  5. When the wizard asks how you want to get the values for the control, do one of the following:
    • If you want to display the current data from a record source, click I want the list box/combo box to look up the values in a table or query.
    • If you want to display a fixed list of values that will seldom change, click I will type in the values that I want.
    • If you want the control to perform a find operation, rather than serve as a data entry tool, click Find a record on my form based on the value I selected in my list box/combo box. This creates an unbound control with an embedded macro that performs a find operation based on the value the user enters.
  6. Follow the instructions for specifying how the values will appear.
  7. If you chose one of the first two options on the first page of the wizard, the wizard asks what you want Access to do when you select a value. Do one of the following:
    • To create an unbound control, click Remember the value for later use. This means that Access will hold the selected value until the user changes it or closes the form, but it will not write the value to a table.
    • To create a bound control, click Store that value in this field, and then select the field you want to bind the control to.
  8. Click Next and type a label for the control. This label will be displayed next to the control.
  9. Click Finish.

Top of Page

Create a list box or a combo box by adding a Lookup field to a form

You can create a bound list box or combo box by adding a Lookup field to a form.

  1. Create a Lookup field in a table. The Lookup field you create can be either multivalued or contain a single value.
    For more information about creating multivalued Lookup fields, see the article Create or delete a multivalued field.
  2. Do one of the following:
    • Create a new form that is based on a record source that includes the Lookup field. For example, in the Navigation Pane, select a table or query that contains the Lookup field, and then on the Create tab, in the Forms group, click Form.
      Access automatically creates a combo box for the Lookup field.
    • Add a list box or combo box to a form:
      1. In Design view, open a form that is based on a record source that includes the Lookup field.
      2. If the Field List pane isn't displayed, press Alt+F8 to display it.
      3. Double-click the Lookup field, or drag the Lookup field from the Field List pane to the form. Access automatically creates a combo box bound to the field.
      Tip: To change a combo box to a list box (or vice versa), right-click the control, click Change To on the shortcut menu, and then click the control type you want.

Top of Page

Create a list box or a combo box without using a wizard

When you create a list box or combo box without using a wizard, you set many of the properties of the control yourself. If you want more information about a particular property, click the appropriate property box and press F1.

  1. Open a form in Design view.
  2. On the Form Design tab, in the Controls group, ensure that Use Control Wizards is not selected.
  3. Click the List Box tool or the Combo Box Button image tool.
  4. Click once inside the form to create a default-sized control, or click and drag until the control is the size you want.
  5. With the control still selected, press F4 to open its property sheet.
  6. Set the Row Source Type and Row Source properties, with guidance from the following table.
    To do this... set the Row Source Type property to... and set the Row Source property as follows:
    Show values from a table or query, or the results of an SQL statement Table/Query In the drop-down list, select the table or query containing the values that you want to appear in the list box or combo box. –or– Type an SQL statement. –or– On the Data tab of the property sheet, click Builder button to open the Query Builder. For more information about building a query, see the article Create a simple select query.
    Show a fixed list of values Value List Type a list of fixed values separated by semicolons (;). For example, North;South;East;West –or– On the Data tab of the property sheet, click Builder button to open the Edit List Items dialog box, and then type the items on separate lines.
    Show a list of fields from a table or query Field List In the drop-down list, select the table or query containing the field names that you want to appear in the list box or combo box.
  7. If you want more than one column to appear in the control, click the Column Count property box and type the number of columns you want. Set the Column Widths property to adjust the widths of the columns. For more information about each property, place the cursor in the property box and then press F1.
  8. If you want Access to store the value you select, click the Control Source property box and select the field to which you want to bind the list box or combo box.

Top of Page

Customize a list box or a combo box

With the form open in Design view, ensure that the list box or combo box is selected, and then press F4 to open the property sheet for the control. Then, do one of the following:

Top of Page