Synchronizing Multiple Combo boxes to view matching data on a Form

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

Guest

Hi, I am trying to use multiple (2) combo boxes on a form to filter out and show specific data on a form. For example I want to choose a state in the 1st combo box and I want the 2nd combo box to give me a list of choices of major cities only in the state from the 1st combo box. After I choose the major cities, I want all records (peoples names and address) to show up on the form. Does anyone have an idea on how this can be done? I'm hoping there's not too much VB involved here.

Thank you.
 
If you don't want to use VB, make the rowsources for the
combo boxes dependent on each other and attach an event
that updates the other combo box when one is changed. Go
to design view, select a combo box, go to the rowsource
entry under the data tab. You've probably got a table or a
query there. Click on the ellipsis (...) button to the
right of the box. Access will ask you whether you want to
create a query - click yes. In the query, find the field
that is depended on the other combo box and set the
criteria. Here is a nearly foolproof criteria:

Like
IIF(IsNull([Forms]![FormName]![ComboBox1]),"*",[Forms]![FormName]![ComboBox1])

Next, attach an event procedure (or macro) to the
AfterUpdate event and use the following:

Me.ComboBox2.Requery

There are a number of different ways to do this, but this
is probably the easiest.

-----Original Message-----
Hi, I am trying to use multiple (2) combo boxes on a form
to filter out and show specific data on a form. For
example I want to choose a state in the 1st combo box and I
want the 2nd combo box to give me a list of choices of
major cities only in the state from the 1st combo box.
After I choose the major cities, I want all records
(peoples names and address) to show up on the form. Does
anyone have an idea on how this can be done? I'm hoping
there's not too much VB involved here.
 
I'm not sure what you mean by "filter information."
Subforms are pretty easy to use though. You might want to
create a query based on the combo boxes and then make a
subform based on the query.
-----Original Message-----
Great, I have the combo boxes working thank you. Now all I
need to do is figure out how to use both these Combo boxes
to filter information. Any thoughts? Should I use a subform?
Thank you.
--
MSS


kingston said:
If you don't want to use VB, make the rowsources for the
combo boxes dependent on each other and attach an event
that updates the other combo box when one is changed. Go
to design view, select a combo box, go to the rowsource
entry under the data tab. You've probably got a table or a
query there. Click on the ellipsis (...) button to the
right of the box. Access will ask you whether you want to
create a query - click yes. In the query, find the field
that is depended on the other combo box and set the
criteria. Here is a nearly foolproof criteria:

Like
IIF(IsNull([Forms]![FormName]![ComboBox1]),"*",[Forms]![FormName]![ComboBox1])

Next, attach an event procedure (or macro) to the
AfterUpdate event and use the following:

Me.ComboBox2.Requery

There are a number of different ways to do this, but this
is probably the easiest.

-----Original Message-----
Hi, I am trying to use multiple (2) combo boxes on a form
to filter out and show specific data on a form. For
example I want to choose a state in the 1st combo box and I
want the 2nd combo box to give me a list of choices of
major cities only in the state from the 1st combo box.
After I choose the major cities, I want all records
(peoples names and address) to show up on the form. Does
anyone have an idea on how this can be done? I'm hoping
there's not too much VB involved here.
Thank you.
.
 
Back
Top