Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2007

Tip: Looking for answers? Try searching our database.

Update date when record is revised

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nicole - 18 May 2007 19:09 GMT
I would like to update the date field on a record whenever that record is
modified.  I've tried the following code which I got from MS Help without
success.  I've installed this code in the Before Update property of the
date/time field.

On Error GoTo BeforeUpdateErr

'Set bound control to system date.
DateModified = Date

BeforeUpdate_End:

Exit Sub

BeforeUpdate_Err
MsgBox Err.Description, vbCritical & vbOKOnly,_
"Error Number" & Err.Number & "Occurred"
Resome BeforeUpdate_End
Klatuu - 18 May 2007 19:22 GMT
It really should go in the Before Update event of the form, not the control.  
You said you want a date when the record is updated, but what you are trying
would update the date even if a user only viewed the record.

Assuming DateModified is a control on your form (can't tell because you
don't use good naming conventions), It should be:

   Me.DateModified = Date

Signature

Dave Hargis, Microsoft Access MVP

> I would like to update the date field on a record whenever that record is
> modified.  I've tried the following code which I got from MS Help without
[quoted text clipped - 14 lines]
> "Error Number" & Err.Number & "Occurred"
> Resome BeforeUpdate_End
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.