Sync Combo Boxes

M

Martin

I need to find a way where I can make a selection in one combo box and
update the available list of selctions in another combo box.

Right now, I have two combo boxes (cboBldg) and (cboFloor). The
problem is that if I have a user select a building, there are options
to select any floor in any building in the floor combo box. I want
them to select a building and then only have the option to select a
floor from the proper building after that.

I'm using Access 2002 and I haven't been able to find anything to show
me how to do this. The actual data for the fields is in two different
tables and they are related to the main table by the ID (autonumber)
field of each.

I appreciate any help that can be provided.
 
K

Kelvin

First off, you should not use a table as the source for a combo box.
Instead use a query. Then for the query of the second form add a criteria
based on the choice of the first box. In your situation, the query for the
second box would be based tblFloor. Add 2 fields, Floor and Bldg. Set the
criteria for Bldg to be Forms!frmNameOfForm!cboBldg. This will restrict the
query so that when you make a choice in cboBldg, only the floors of that
building are listed. Then on your form, in the AfterUpdate event of the
first combo box cboBldg add Me.cboFloor.Requery. This will update the list
in cboFloor each time cboBldg is changed.

Kelvin
 

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