Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 Combo Boxes in a Parent/Child Relationship 1

Status
Not open for further replies.

Geekette

MIS
Jun 5, 1999
27
US
The user must first choose a doctor, then choose an appropriate office location.<br>
The Parent combo box contains the list of doctors, with did# as the indexed field.<br>
I want the Child combo box to contain the offices for the chosen doctor. The office has an index of did#,did_loc#. How can I make this combo box reference the former one?<br>

 
1. Refresh the Office combobox (Me!OfficeCombo.Requery) in the AfterUpdate event of the Doctor combobox. <br>
2. Set the RowSource Type property of the Office combobox to table/query.<br>
3. Build a query in the RowSouce propery that includes DoctorID and Office ID.<br>
4. Set the query's criteria in DID# to the Doctor combobox value (Forms!FormName!Doctor).<br>
5. Set the Column Count property of the combobox to 2 and the Column Widths to 0,n. (n=whatever width you need to display the values for office).<br>
<br>
I usually set the Limit to List property to Yes and put code in to pop up a data entry form as needed.<br>
<br>

 
Check Tech-Net for example. Very similar to one described above. <br>
<br>
Q97624 - ACC: How to Synchronize Two Combo Boxes on a Form <br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top