Provided by: Molly Pell, Senior Systems Analyst

Most commonly, the list of values is from a table or query, and can be bound to one field (like an ID field) while displaying a field the
user sees and understands. Combo boxes in Access also support the display of multiple columns so you can show more data to make it easier to select the right item.

Brush up on the
ComboBox Basics from Microsoft, and check out our Top Five Tips for using Combo Boxes on Microsoft Access forms. Each has articles
describing them in more detail.

ComboBox Tip 1: Set Important Display Properties

To use combo boxes effectively, learn about the following properties:

LimitToList: Set this property to Yes to prevent values that are not in your list.

AutoExpand: Set this property to Yes to automatically select a matching value in the list as you type.

ListRows: Set this value to a high value so that the drop down shows as many list items as space allows.

ComboBox Tip 2: Properly Validate the Selection

In forms, the BeforeUpdate event is used to validate the entries in the current record. For Combo Boxes, people often check if the value exists by
looking for Null. This works in most cases, but not all.

If the combo box is on a bound field, there may be an existing value that is not valid. For example, the value may have been in the list when it was
originally selected, but the current list of allowed values has changed.

If you simply check for IsNull, Access says it is not null. This is accurate, but what you really want to know is if a valid value was selected.

Instead, you should use the ListIndex property:

If Me.cboName.ListIndex = -1 Then
MsgBox "A value is required for ...."
Me.cboName.SetFocus
Cancel = True
End If

ComboBox Tip 4:
Create Cascading ComboBoxes

On a form with multiple ComboBoxes, you may want to make the selection in one ComboBox limit the choices in another ComboBox. To do this, add code to
the AfterUpdate event of the first control that updates the RowSource property of the second control:

ComboBox Tip 5: Create Country and State Combo Boxes, plus Zip Code Lookup with Auto-Fill City and State Names

For data entry of addresses, we like to speed data entry and improve accuracy by forcing users to select countries from a combo box list,
along with state if it's a country with a state list. Additionally, we use a zip code lookup table to fill in city and state values.
This improve accuracy by eliminating typos on city names and flagging wrong zip codes if the city doesn't match.

Some zip codes have multiple acceptable cities. With a zip code lookup table from the US Postal Service (provided by our
Total Zip Code Database subscription), we can easily provide a lookup for city and state,
plus add a ComboBox for selecting valid city names:

Example of Country and State ComboBoxes with Zip Code Lookup of City/State Names and Multiple City ComboBox