Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field requery doesn't work after save

Status
Not open for further replies.

tpolony

Programmer
Joined
Aug 9, 2003
Messages
17
Location
US
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!
 
try

me.recalc

instead of the requery.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top