Access Controls  «Prev  Next»
Lesson 2Combo Box and List Box controls
ObjectiveWork with controls that display data from other record sources.

Microsoft Access Combo Box and List Box Controls

The Combo Box and List Box controls are two of the most versatile controls available in Access.
They allow you to display and pick data from a lookup table and they allow you to display data from other tables without requiring joins in the underlying record source of the form or report on which they are used. You got a taste of using the Combo Box and List Box controls as lookup fields in Module 2. You also saw how to use the Combo Box and List Box Wizards.
To use the wizards to place the controls on forms, you can drag and drop the controls from the toolbox by using either the Combo Box control button
Combo Box control button
Combo Box control button
or the List Box control button
List Box control button
List Box control button

I would like to take this opportunity to expand on that knowledge for you.

Important Properties of the Access Combo Box and List Box Controls

The wizards do a good job of creating the controls that are needed to use simple Combo Box and List Box controls. To take advantage of some of the more advanced features, however, you will need to be comfortable with some of the properties of the Combo Box and List Box controls. You can see some of those properties in the diagram below.


MS Combo Properties
MS Combo Properties

1)Name Name of the Combo Box or List Box control.
2)Control source Field in the underlying record source of the form to use.
3)Row source type Choices here are Table\Query, Value List, and Field List. It lets you specify how to populate the control.
4)Row source Can be a SQL statement, a table or query name, or a list separated by semicolons.
5)Column count Number of columns to use in the control from the row source.
6)Column heads Includes a row in the control that will act as column headings.
7)Column widths How wide do you want each column? A column width of zero doesn’t display anything, but the data is still available.
8)Bound column The column in the row source to be entered into the control source.
9)List rows Number of rows that will be displayed.
10)List width Width of the displayed list.
11)Limit to list Whether to require the data entered to be limited to the list.
12)Auto expand Will search the list and move you to the next entry that matches the characters currently entered. If you are using a large row source for the list, you may want to set this to No for better performance

Using the properties pointed out by the diagram, you can display additional information on a form using a Combo Box or List Box control.

Displaying Additional Information on an Access Form

To display additional information by using a Combo Box or List Box control, set the properties of the control this way:
  1. Include the fields to be displayed in the Row Source property.
  2. Set the Column Count property to reflect the total number of columns you want to include.
  3. Set the Column Widths property to 0 to hide the extra columns.

You can then create calculated fields and set the Control Source property of them to the column of the Combo Box or List Box control you desire to display. The form below displays the phone number of the client beside the combo box when a client is chosen.

The form below displays the phone number of the client beside the combo box when a client is chosen.
Form image: The form below displays the phone number of the client beside the combo box when a client is chosen.


Here are the settings for the combo box:
Property Setting
Row Source Select ClientNo, Company, Phone from Clients
Column Count 3
Column Widths 0”;1”;0”

The calculated field next to the combo box, called txtPhone, has its Control Source property set to
=cboClient.Column(2)

where:
  1. cboClient is the name of the Combo Box control.
  2. Column(2) is the third column over (starting from 0).

In the next lesson, you will learn how to use the Option Group Wizard to create an Option Group control.