Query for Sub form

  • Thread starter Thread starter B Nieds
  • Start date Start date
B

B Nieds

Hi:

I have a combo box on a form which has a query (in row source) to populate
the combo box. Based on the selection the user makes in the combo box I
would like the form to populate the subform connected to the form.

I thought I understood the process but something is missing since the
subform does not change when I make a selection from the combo box. The
query says Select DepCde, ProjPhase from tDepRec Order By DepCde; The Combo
Box return ProjPhase which is common to the subForm.

Thanks
Bill
 
In a standard design, a combo box would be used to select a given record for
the main form. The subform is typically used to show the "many" side of a
one-to-many relationship between the records displayed in the main form and
the "child"/related records for each (displayed in the subform).

To do this, the subform control on the main form has the parent & child
linking fields/properties set.

If done in this manner, selecting a new main form record automatically
refreshes the subform to display the related records.

Or have I misunderstood your situation?
 
Hi Jeff:

Yes that is what I thought I was trying to do. There is only one DepCde and
there can be many ProjPhase per DepCde. I would like the user to select a
DepCde and then have the subform display all the ProjPhase for that DepCde.

I am still not sure what I am doing wrong though.

Thanks
Bill
 
Bill

What fields are you using in the subform control to link mainform and
subform?

After you select a DepCde, do you use the AfterUpdate event of that combo
box to requery the mainform?
 
Hi Jeff:

I decided to scrap the form and rebuild it and that fixed the problem. I
cannot see what I did different so I will just chauk it up to needing new
glasses.

Thanks for your willingness to help.
Bill
 
Back
Top