Populate combo field on form

  • Thread starter Thread starter Mhebor
  • Start date Start date
M

Mhebor

How would I populate a combo box field on a form based on what is
entered into another combo box. I have a table for different state
agencies and another for contact person. If a person chooses an agency
in the first combo field, I want the other combo box populated by
contacts for that agency only. Thank You in advance.
 
The second combo box row source should be a query limited by the first combo
box,
Also the first combo box should have an after update event, requerying the
2nd combo box,
 
How would I populate a combo box field on a form based on what is
entered into another combo box. I have a table for different state
agencies and another for contact person. If a person chooses an agency
in the first combo field, I want the other combo box populated by
contacts for that agency only. Thank You in advance.


Take a look at this article:
http://www.mvps.org/access/forms/frm0028.htm
 

These suggestions worked, but I'm not getting the results I am looking
for. Instead of the Field name being selected in the first combo box,
I would like the value of the first combo box to determine what can be
chosen in the second combo box. On another note, how do you requery
the 2nd combo box in the after_update event in the 1st combo box.
Thanks for the quick reponse.
 
These suggestions worked, but I'm not getting the results I am looking
for. Instead of the Field name being selected in the first combo box,
I would like the value of the first combo box to determine what can be
chosen in the second combo box. On another note, how do you requery
the 2nd combo box in the after_update event in the 1st combo box.


You are doing something wrong. Perhaps the value of the
first combo's BoundColumn is not what you need? It's
impossible for me to provide a detailed explanation without
knowing exactly what the RowSource and BoundColumn
properties of the two combo boxes and the fields that relate
the two.

The first combo box's AfterUpdate event procedure should be
like:
Me.secondcombo = Null
Me.secondcombo.Requery
 
Back
Top