In an Access form, how do I handle 2 related combo boxes?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with 2 combo boxes, the selection made from the first combo
will be the criteria for the second one.
How do I implement this ?

Thanks for any help or leads.
 
Martn said:
I have a form with 2 combo boxes, the selection made from the "A" combo
will be the criteria for the "B" one.
How do I implement this ?

Thanks for any help or leads.

Piece of cake, Holmes.

On the "B" combo box, go to properties, go to Row Source, right click,
"build"
This puts you in "SQL Statement : Query Builder" Land
Select table(s) that contain the fields both your combo boxes reference
Select your fields ("B" combo box reference field 1st, then the "A" combo
box reference field 2nd)
Click Totals (sigma) in toolbar
Below, In the 1st field (your "B" combo box ref field) change Totals: from
"Group by" to "Expression"
In the 2nd field (your "A" combo box ref field) change Totals: from "Group
by" to "Where"
Go to Criteria in 2nd field (your "A"), right click, "build"
This takes you to Expression Builder Land
Double click "Forms", "Loaded Forms" or "All Forms", "[the form with your
combo boxes]"
Then in the middle list double click on the Properties Name of your "A" combo
box
Click OK in the upper right.
Save your query, name it, get out of properties, save your form, open your
form and use it.
If you go back to Properties, Row source, build, and look at the SQL view,
you should see something like
this:
SELECT Orders.Seller
<-- (Select the "B"'s)
FROM Orders
<-- (From the Table)
WHERE (((Orders.Buyer)=[Forms]![Form1]![ComboBuyer])) <-- (Where your "A" is
what you combo selected)

L8
 
Back
Top