Synchronizing Combo Boxes on Forms in Access 2007
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
Applies to: 2007 Microsoft Office System, Microsoft Office Access 2007
Joel Krist, Akona Systems
When you build custom Microsoft Office Access 2007 applications, there are often situations where it is useful to synchronize two combination boxes (combo boxes) on an Access 2007 form so that when you select an item in the first combo box, that selection limits the choices in the second combo box. For example, it might be necessary to limit the products that are displayed in a combo box based on the category that is selected in another combo box. The Access 2007 combo box control generates the AfterUpdate event when an item in the combo box is selected. This article illustrates how to use the combo box AfterUpdate event to synchronize two combo boxes on an Access 2007 form.
This section walks through two steps to illustrate how to synchronize two combo boxes on an Access 2007 form:
To illustrate the steps required to synchronize two combo boxes, the code provided in this article works with a sample database that has the following characteristics:
Add an Event Procedure for the Combo Box AfterUpdate Event
To add an AfterUpdate event procedure for the Categories combo box
Add Code to the AfterUpdate Event Procedure
Modify the cboCategories_AfterUpdate event procedure created previously so that it sets the RowSource property of the Products combo box based on the category that is selected in the Categories combo box. This causes the Products combo box to display only those products whose category matches the category that was selected in the Categories combo box.
When you build custom Access 2007 solutions, it is often useful to synchronize two combo boxes on an Access 2007 form. This ensures that when an item is selected in the first combo box, that selection limits the choices in the second combo box. This article explores how to synchronize two combo boxes on an Access 2007 form. The key steps include:
Video Length: 00:04:46
File Size: 3.37 MB
File Type: WMV