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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preserving old values of updated field

Status
Not open for further replies.

Joels7

MIS
May 1, 2001
9
US
I would like to preserve the old values of an updated field in a new field. So if my table consists of the following:

F1 F2
Rec1 1 0

Rec2 2 0

Rec3 3 0

After an update to F1 I would want the table to read:


F1 F2
Rec1 2 1

Rec2 4 2

Rec3 6 3



How can I accomplish this?

Thanks,

Joels7
schneierj@trfund.com


 
ummmm quickly off the top of my head you could have a third field such as F1_Temp and use this to store the values of F1.

So AfterUpdate for F1:

F2 recieves the value of F1_temp and then F1_Temp will recieve the value of F1.

hope this helps...

wah
 
Access retains the "before change" value of each field in its OldValue property. You could use code like the following to track the changes:
Code:
Private Sub F1_AfterUpdate()
  Me!F2 = Me!F1.OldValue
End Sub

 
see faq181-291

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top