Creating Cascading Combo Boxes and List
Boxes on Microsoft
Molly Pell, Senior Systems Analyst
Sample database: CascadingComboBoxes.zip (62 KB)
Combo boxes and list boxes are a great way to
control user experience by limiting the values
that a user can choose to a known list.
In Microsoft Access, a common need is to have multiple combo boxes or
list boxes on a form, and to have the selection in one combo box limit the
choices in a second combo box. For example, an Address form
containing Country and State lookups. When you select a country, its list of
Our this sample database, we have a list of species, both plants
and animals, categorized by their taxonomic rank (kingdom, phylum, class,
order, family, genus, then species).
If you select the value "Animal" from the Kingdom combo box, the
Phylum combo box is updated to show Animal phylums only. The
Species list box is also filtered by your selection.
This is known as cascading combo boxes or synchronized combo
To create the cascading combo box, we add
code in the "AfterUpdate" event for the Kingdom
combo box, to update the RowSource property of
the Phylum combo box based on the selected
' Set the Phylum combo box to be limited by the selected Kingdom
Me.cboPhylumID.RowSource = "SELECT PhylumID, PhylumName " & _
"FROM tblPhylum " & _
"WHERE KingdomID = " & Nz(Me.cboKingdomID) & _
"ORDER BY PhylumName"
Additionally, we add code to update the contents of the Species list box:
' Limit the Species list box
Me.lstSpeciesID.RowSource = "SELECT SpeciesName, Description " & _
"FROM qryTaxonomy " & _
"WHERE KingdomID = " & Me.cboKingdomID
' Refresh the list box
After updating the RowSource
property, use the list box's
Requery method to re-load the data in the ListBox.
RecordSource versus RowSource
There is sometimes confusion between the terms
RecordSource and RowSource. Both are properties that can
contain a table, query, or SQL string.
is a form or report property to populate the data that
Microsoft Access displays for that object.
is at the ComboBox or ListBox control level that tells
Microsoft Access what data to display for the control.
It is independent of the data specified by the object's RecordSource.
How to: Synchronize Two Combo Boxes on a
Resources for Microsoft Access Forms, Combo Boxes and Tabs