totn Access

MS Access 2003: Populate one combo box based on the selection of another combo box

This MSAccess tutorial explains how to populate one combo box based on the selection of another combo box in Access 2003 (with screenshots).

Question: In Microsoft Access 2003/XP/2000/97, I have a combo box that displays values based on the selection of another combo box. My problem is that when I make a different selection in the first combo box, the text in the second combo box does not change. Although the drop-down items are correctly changed in the second combo box. I have tried to requery but it doesn't work! Any suggestions?

Answer: We've provided a download to demonstrate how to properly refresh the second combo box based on the selection of the first combo box.

Download version in Access 2000

Let's look at the example. Below is a form that contains two combo boxes. One is called CategoryID and the second is called ProductID. When a value is selected in the CategoryID combo box, the ProductID combo box repopulates its list of items based on the CategoryID chosen.

Microsoft Access

The trick to properly populating the second combo box called ProductID is how the RowSource is defined. The RowSource for the ProductID combo box is based on a UNION query that lists the records from the Product table as well as a row that contains null values. The purpose of the null value row is to clear the selection in the ProductID combo box.