this code returns it back to first record of subform
Code:
Private Sub Form_AfterUpdate()
Dim RecordID As Long
Application.Echo False 'turn off screen updating
RecordID = Me.InvoiceLineItemID 'store the current ID
Form_frm_Invoice.InvoicePayments = DSum("[LineTotal]", "qry_InvoiceLineItemPayments", "InvoiceID =" & Form_frm_Invoice.InvoiceIDBOX)
Form_frm_Invoice.InvoiceAddendums = DSum("[LineTotal]", "qry_InvoiceLineItemAddendums", "InvoiceID =" & Form_frm_Invoice.InvoiceIDBOX)
Me.InvoiceLineItemID.SetFocus
DoCmd.FindRecord RecordID 'get back to starting record
DoCmd.GoToRecord , , acNext ' comment this out if you want to stay where you started
Application.Echo True 'turn on screen updating
End Sub
This Code Works but seems excessive
Code:
Private Sub Form_AfterUpdate()
Dim RecordID As Long
Application.Echo False 'turn off screen updating
RecordID = Me.InvoiceLineItemID 'store the current ID
Form_frm_Invoice.InvoicePayments = DSum("[LineTotal]", "qry_InvoiceLineItemPayments", "InvoiceID =" & Form_frm_Invoice.InvoiceIDBOX)
Me.InvoiceLineItemID.SetFocus
DoCmd.FindRecord RecordID 'get back to starting record
DoCmd.GoToRecord , , acNext ' comment this out if you want to stay where you started
Application.Echo True 'turn on screen updating
Form_frm_Invoice.InvoiceAddendums = DSum("[LineTotal]", "qry_InvoiceLineItemAddendums", "InvoiceID =" & Form_frm_Invoice.InvoiceIDBOX)
Me.InvoiceLineItemID.SetFocus
DoCmd.FindRecord RecordID 'get back to starting record
DoCmd.GoToRecord , , acNext ' comment this out if you want to stay where you started
Application.Echo True 'turn on screen updating
End Sub
Thoughts?