Question
May 21, 2007 at 08:16 AM
sue.berger

Transfer data from one subform to be calculated in a second subform

by sue.berger . Updated 19 years, 5 months ago

I am working in an Access2000 database which I created. I have a Payment Data Entry main form which has 5 subforms.

frm_PaymentDataEntry is the main form.
On tab1 (Payments) there is SUBfrm_Payments. The field [Payment Amount]updates to tbl_Payment so that the totals can be calculated on tab2.

Tab2 (Payment Totals) pulls the information from tbl_Payments and fills the field with =Sum([Payment Amount]).

The calculation is working fine, but it’s not picking up the entries from tab1 unless the form is refreshed to show all records, then requeried.

I need some sort of code to force the save of the records entered on tab1 when the user clicks over to tab2.

I’ve gotten advice from other experts, but no success. Here’s what I’ve already tried:

1.) This code in the on_click event of tab 1
DoCmd.GoToRecord acDataForm, “SUBfrm_Payments”, acNext
DoCmd.GoToRecord acDataForm, “SUBfrm_Payments”, acPrevious”

2.) In the ‘onclick’ event of tab1 use this code Me.Refresh

3.) In the ‘onclick’ event of tab1 use this code DoCmd.RunCommand acCmdSaveRecord

4.) In the Lost Focus event of the Tab1 subform:

Me.Dirty=False
Me.SUBfrm_PaymentTotals.Requery

5.) Even if I use the Shift+Enter function at the end of the data entry the record is not showing up on the second tab.

Any suggestions?

Thanks
Sue

This discussion is locked

All Comments