Inserting a date/time stamp

Fallen

New member
Local time
Today, 17:25
Joined
Dec 8, 2012
Messages
5
Hi,

I am trying to insert a date/time stamp on records that have been entered, edited or updated by a user. I have searched google and you tube but I cannot get a direct solution. Does anyone have an idea how this should be done using Access 2010?
 
If you want to add date in new records, use Before Update event of the form something like below:

If not Me.newRecord then
FieldName = Date()

Alternatively, use buttons on click events when you edit some record

FieldName = date()

if you need time as well,

then fieldname = now()
 
I did not notice that you posted in Macro forum, although I seen much control for such jobs in VBA, but if anyway you need Macros, then you may use SetValue macro.

Action: SetValue
Item: [NameOfTheDateControl]
Expression: Date() or Now()

You may use condition when date should be placed but I do not have idea how to propoerly write conditions.
 
Hey Mahenkj2 or Anyone!

I inserted the code and it worked fine the first time but 2 days later, it stopped working. I created the fields in my database and on the form (hidden). What is stopping the table from overwriting the old dates after making changes on the form as it is attached to the correct table.

Thanks,
Fallen
 

Users who are viewing this thread

Back
Top Bottom