none
SubForms - Access Basic 2003 RRS feed

  • Question

  • I have an Accounting Payments form (MainFrm) and a SubFrm for account allocations (Continuous records).  The Subfrm updates the MainFrm with the total of Allocations to balance the total Payment record.

    When Closing(Saving) the Mainfrm I need to ensure that any updates or changes to the SubFrm have been properly updated to the MainFrm, ie that all records in the SubFrm have been properly Closed(Balanced and Saved).
    To achive this I have included as the first line in the SAVE command of the MainFrm -"Me.SubFrm.SetFocus", and then a command to ensure all subfrm records are completed and balanced - which works fine - EXCEPT that I cannot then get back to the MainFrm SAVE command to complete other checks and controls.
    It correctly flags any errors etc in the SubFrm, but refuses then to return to the SAVE command to continue the SAVING of the MainFrm record. The SubFrm simply remains open and stalls the whole SAVING process.

    My only solution is to have two SAVE commands - the 1st to Close and Save the SubFrm, and the 2nd to Close the now balanced MainFrm. This is a clumsy solution and I would prefer to have only one SAVE command that accesses the SubFrm then continues on in the MainFrm SAVE command.

    Can anybody see how to move back to the Mainfrm SAVE command after rebalancing the SubFrm. I tried inserting Me.MainFrm.SetFocus but system would not allow.

     

     


    Glynn Blackwood
    Saturday, January 7, 2012 2:48 AM

Answers