Using value from Combo box in query

  • Thread starter Thread starter Pharoah
  • Start date Start date
P

Pharoah

Basically I have a form with 2 combo boxes. The first
cbo lists Builders, the second cbo list the housing
communities they build. I want the second cbo to list
only those communities that the user selects in the first
one.

(e.g., User selects Distinctive Homes in cbo1, then
clicks on cbo2, box should only display (Canyons, Falls,
Gables, and Hills)) not all the communities.

The tables are linked by a Bldr ID
 
Make the Row Source of the second combo box a parameter query. The
parameter will look like:

WHERE [Bldr ID] = [Forms]![MyForm]![cbo1]

... where "MyForm" is the name of your form. In the AfterUpdate event of
cbo1, requery cbo2.

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
 
Back
Top