Problem linking the second subform to the first one

G

Guest

Hello,

My main form’s recordsource contains work orders headers. The first subform
(datasheet view) contains work order details (item records) and linked to the
main form through the work order number field. I do not have problems
adding/editing records in the first subform.

The second subform (datasheet view) contains production records (quantity
manufactured for each item in work order by date). So, the second subform
linked to the first subform through the work order number and item code
fields. I created the Child/Master field links on the second subform and run
in On Current event of the first subform the following command:

Me.Parent![Second Subform Name].Requery.

The problem is that when I move from record to record on the first subform,
the data on the second subform do not get updated.

What is wrong or should be done?

Thanks.
 
J

Joan Wild

Here's a method that requires no code:

Put a textbox on the main form and set its control source to the primary key of the first subform:
=[NameOfFirstSubformControl].[Form]![OrderDetailID]
Give this textbox a name of txtLink

Set the Link Master/Child properties of the second subform control to
Master - txtLink
Chile - OrderDetailID
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top