Date Stamp For Edited Record

JamesJoey

Registered User.
Local time
Today, 10:52
Joined
Dec 6, 2010
Messages
642
I need a date field that will automatically display the date that the record was edited and saved.

I have a table with three fields:
BalanceID
Balance
BalanceDate

I put data into Balance manually and would like BalanceDate to automatically record the date Balance was update.

James
 
Here is one way.

To record the date/time the record was last updated, add a field to the
table named (say) "UpdatedOn", and put this code into the BeforeUpdate event
procedure of the form where records are edited:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Me![UpdatedOn] = Now()
End Sub

To record a complete history of who edited/inserted/deleted which record
when, recording both the old and new values each time, see:
Audit Trail - Log changes at the record level
at:
http://users.bigpond.net.au/abrowne1/AppAudit.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to the newsgroup. (Email address has spurious "_SpamTrap")
 
Works fine.

Thanks much,
James
 
You might also want to compare OldValue with NewValue before writing your date.
 

Users who are viewing this thread

Back
Top Bottom