ACC2000: How to Synchronize Two Combo Boxes on a FormID: Q209595
|
This article shows you how to synchronize two combo boxes so that when you make a selection in the first combo box, the selection limits the choices in the second combo box.
The following example uses the sample database Northwind.mdb. The first combo box lists the available product categories, and the second combo box lists the available products for the category selected in the first combo box:
Microsoft provides programming examples for illustration only, without warranty
either expressed or implied, including, but not limited to, the implied warranties of
merchantability and/or fitness for a particular purpose. This article assumes that you
are familiar with the programming language being demonstrated and the tools used to
create and debug procedures. Microsoft support professionals can help explain the functionality
of a particular procedure, but they will not modify these examples to provide added
functionality or construct procedures to meet your specific needs. If you have limited
programming experience, you may want to contact a Microsoft Certified Solution Provider
or the Microsoft fee-based consulting line at (800) 936-5200. For more information about
Microsoft Certified Solution Providers, please see the following page on the World Wide Web:
http://www.microsoft.com/mcsp/For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://www.microsoft.com/support/supportnet/overview/overview.asp
Combo Box 1
-------------------------------
Name: Categories
RowSourceType: Table/Query
RowSource: Categories
ColumnCount: 2
ColumnWidths: 0";1"
BoundColumn: 1
AfterUpdate: [Event Procedure]
Combo Box 2
--------------------------
Name: Products
RowSourceType: Table/Query
ColumnWidths: 2"
Width: 2"
NOTE: If you are in an Access project, the RowSourceType will be Table/View/StoredProc.
Me.Products.RowSource = "SELECT ProductName FROM" & _
" Products WHERE CategoryID = " & Me.Categories & _
" ORDER BY ProductName"
Me.Products = Me.Products.ItemData(0)
Additional query words: inf listbox combobox link
Keywords : kbdta FmsCmbo
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: July 6, 1999