SubForm saving issue

ted.martin

Registered User.
Local time
Today, 18:59
Joined
Sep 24, 2004
Messages
743
I have a continuous form of Quotations (as a summary) where d/c one of the controls opens a particular Quotation as a main form.

The Quotation mainform has a sub form for all the quotation components including Totals in the footer section of the subform. The total is brought back to the main form and saved into the mainform (Quotation header) record.

The issue I have is that when I change a price one of the subform records, if the user goes straight to the mainform close button, the continuous form does not update the total value; despite having a continuous form requery in the mainform close button event.

However, if the user goes from subform record to any control on the main form, then then the Quotation mainform updates and after the Close button on the mainform, the (summary) Quotations continuous form updates fine.

It seems to me that the mainform close button does not allow the mainform to update the record before it closes. I do have a save command in the close button event but that seems to do nothing.
 
Last edited:
You would need to ensure the underlying record is saved before the requery / refresh of the other forms.

If you set the quotation as a modal form you could put some code after the Quote open code to requery the data as it won't run until the Quotation form is closed. That might help.

If not I would post up the codes for the open and close of the Quotation form.
Bear in mind that the best and quickest way to save a record is with
Code:
If Me.Dirty Then Me.Dirty = False
And not to mistakenly use
Code:
 DoCmd.Close acForm, "YourForm", acSaveYes
Which only saves Form design changes NOT the record.
 
Thanks: - put a Me.Requery into the Close button code on the main from and that seems to have fixed it.
 

Users who are viewing this thread

Back
Top Bottom