I have a field called TotalAmount, which must recalculate anytime SomeAmount is updated. Let's say I just changed SomeAmount from 3 to 4, and so TotalAmount also changes from 3 to 4. The following code, using Requery, doesn't refresh the value. What am I doing wrong?
SomeAmount_AfterUpdate()
Debug.Print "Total amount before saving = " & TotalAmount ' prints 3
' saves the 4 toSomeAmount on the db
DoCmd.RunCommand acCmdSaveRecord
' want to get the new value of 4 ( TotalAmount = Sum[SomeAmount] )
TotalAmount.Requery
Debug.Print "Total amount after saving = " & TotalAmount ' prints 3 still!
Thanks!
SomeAmount_AfterUpdate()
Debug.Print "Total amount before saving = " & TotalAmount ' prints 3
' saves the 4 toSomeAmount on the db
DoCmd.RunCommand acCmdSaveRecord
' want to get the new value of 4 ( TotalAmount = Sum[SomeAmount] )
TotalAmount.Requery
Debug.Print "Total amount after saving = " & TotalAmount ' prints 3 still!
Thanks!