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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box on Main Form to pull information to Subform

Status
Not open for further replies.

sbdeaver

Technical User
Nov 22, 2004
16
EU
I have a main form (frmHDA) that has a combo box pulling all HDAs (Home Delivery Agent), city and company information. The bound column is 1.

I have a subform (sfrmHDA) that includes information in more detail on each HDA. I wrote the query inside the subform to pull down all detailed information for forms!frmHDA!HDAs in the HDA field.

When I open the main form and select a Delivery Agent from the combo box, the subform does not update. I've tried writing code for the After Update (Me!sfrmHDA.Requery) but it does not work.

I would appreciate any help.
 
I think the problem is that subforms are linked to the record in the main form and cannot be filtered away from this record.

Try creating a new combo box in the main form with the wizard and select "find a record on my form based on the value I selected in my combo box".

This will change the record in the main form to your selection and as a consequence, the subform will automatically update.

You will need to remove the forms!frmHDA!HDA criteria in the query which the subform is based on.

Hope this works
 
Unfortunately, I've tried that already and it didn't work.
 
Hi!

Is sfrmHDA the name of the subform or the name of the subform control on the main form? For the requery to work, you need to use the name of the subform control.

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
When I am in the main form with the Properties box open and have clicked on the subform, sfrmHDA is the the "Source Object" on the Data tab and the "Name" on the Other tab. Is there something else that should have it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top