Using value from Combo box in query

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
 
J

John Viescas

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top