G
Guest
I have read many threads here about the topic and basically have it working
with one big problem, the sum displayed is always one record behind. I have
used both LostFocus and AfterUpdate on the Amount field on the subform but
the result is the same. The subform has a text box called InvTotal whose
control is =Sum(Amount).
After entering a payment of 200 on the subform the PmtTotal on the main
still shows 0.00. Then I enter a second payment of 500 and at this point the
PmtTotal shows a value of 200. here is my code and I really appreciate
everyones help.
Private Sub Amount_LostFocus()
Dim lngAmt As Long
With Me.Parent.PmtTotal
.Enabled = True
End With
lngAmt = Nz(Forms!Frm_Payments!SubPmtControl.Form!InvTotal, 0)
Me.Parent.PmtTotal = lngAmt
Me.Parent.PmtTotal.Requery
End Sub
with one big problem, the sum displayed is always one record behind. I have
used both LostFocus and AfterUpdate on the Amount field on the subform but
the result is the same. The subform has a text box called InvTotal whose
control is =Sum(Amount).
After entering a payment of 200 on the subform the PmtTotal on the main
still shows 0.00. Then I enter a second payment of 500 and at this point the
PmtTotal shows a value of 200. here is my code and I really appreciate
everyones help.
Private Sub Amount_LostFocus()
Dim lngAmt As Long
With Me.Parent.PmtTotal
.Enabled = True
End With
lngAmt = Nz(Forms!Frm_Payments!SubPmtControl.Form!InvTotal, 0)
Me.Parent.PmtTotal = lngAmt
Me.Parent.PmtTotal.Requery
End Sub