Refresh Parent form and move to next record on subform

Mimadocken

Registered User.
Local time
Today, 12:36
Joined
Mar 12, 2012
Messages
81
I have two subforms on a "Page"/Tabs. Subform #1 is a continuous form which accepts data about dimensions of a pattern piece. The other subform needs to update its information display each time the last control of the first subform loses focus, because it tells me how much material is required for all pieces of this pattern that are entered.

My first feeble attempt at this was to add the following code to the "Lost Focus" event of the final control on the first subform:
Form.Parent.Refresh

This succeeded in forcing the second subform to re-run its calculation.

However, after the recalculation took place, I wasn't able to move to the next record on the first subform. This subform is a continuous form, and I need to be able to add another row of data and then see the second subform change based on the additional information in the first subform.

Obviously I've done this wrong. Would you please help me make both functions work?

Thank you for any help you can offer.
 
You are not saying anything about how the forms are linked each other. It looks like both sub-forms are linked to the main form on some key values.

I think the best approach is to link the main-form to the first sub-form. Second sub-form to the first sub-form on a common key value.

When you add a new value (key-value) in the first sub-form the second form content will get automatically refreshed without issuing a main-form refresh action.

Check the following link to get an idea as how to link the second sub-form to the first sub-form directly:

Overlaying Sub-Forms in Real-time
 
Last edited:

Users who are viewing this thread

Back
Top Bottom