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

Updating a main form field from an unbound sub-form field

Status
Not open for further replies.

meagain

MIS
Nov 27, 2001
112
CA
Hi,

I have a main form listing items with quantities, and a sub-form that lists the transactions that make up the quantities for the corresponding item. On the sub-form a user changes the quantity in a field, and this sets a value in another field to the difference between the original quantity and the new quantity. Once the record is saved, then an unbound text box in the header of the sub-form recalculates and displays the sum quantity.

Now, I need to update the quantity field in the main form with this revised sum quantity appearing in the sub-form header. How can do this? I have tried an update query, added to the macro which sets the value and saves the record, but when it goes to run, the unbound field containing the sum has yet to display the new figure and therefore updates the main form with the previous value.

How can I time this, so the unbound field has displayed the new value for the main form field to be updated correctly?

Thank you,
LP
 
In the textbox control on your main form, set the Control Source, to the textbox control on your subform.

It will look something like this, in the main form's text box Control Source property:

Code:
=[frmSubForm].[Form]![txtCalcControl]

misscrf

It is never too late to become what you could have been ~ George Eliot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top