468,777 Members | 2,285 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,777 developers. It's quick & easy.

Create/Last Modification Date-Time Stamp

I have a database that is shared my multiple users who enter and update
records on a weekly basis. Is there a way I can add a field to my main
data table that will automatically generate the create date or last
modification date for each record?

Nov 27 '06 #1
3 5964
MarcJoseph wrote:
I have a database that is shared my multiple users who enter and update
records on a weekly basis. Is there a way I can add a field to my main
data table that will automatically generate the create date or last
modification date for each record?
If you only want to record the _last_ date of modification beginning
with the date of creation, then you can write a procedure in the
OnDirty event that uses the CurrentUser method and Now() function to
log the name of the user and the date/time of the last modification
right in the form's recordset after a record is updated. However, a
more elegant approach would be to write some DAO code to create a new
record on a separate table every time the record is updated. Again,
this is accomplished from the OnDirty event.

Alexandre Bejerman
Montreal, Canada

Nov 27 '06 #2
Alexandre,

What is an OnDirty event? I'm a MS Access novice.

Thanks.

Marc

ab****@hotmail.com wrote:
MarcJoseph wrote:
I have a database that is shared my multiple users who enter and update
records on a weekly basis. Is there a way I can add a field to my main
data table that will automatically generate the create date or last
modification date for each record?

If you only want to record the _last_ date of modification beginning
with the date of creation, then you can write a procedure in the
OnDirty event that uses the CurrentUser method and Now() function to
log the name of the user and the date/time of the last modification
right in the form's recordset after a record is updated. However, a
more elegant approach would be to write some DAO code to create a new
record on a separate table every time the record is updated. Again,
this is accomplished from the OnDirty event.

Alexandre Bejerman
Montreal, Canada
Nov 27 '06 #3
Marc:

The OnDirty event is an action that is performed whenever a record is
changed on a form. If OnDirty did not exist, you would have to write a
separate event for every bounded control that is modified (or rather,
that modifies a record) in your form.

If you open your form in design view, you can view all possible
associated events in the properties window.

Alex
MarcJoseph wrote:
Alexandre,

What is an OnDirty event? I'm a MS Access novice.

Thanks.

Marc

ab****@hotmail.com wrote:
MarcJoseph wrote:
I have a database that is shared my multiple users who enter and update
records on a weekly basis. Is there a way I can add a field to my main
data table that will automatically generate the create date or last
modification date for each record?
If you only want to record the _last_ date of modification beginning
with the date of creation, then you can write a procedure in the
OnDirty event that uses the CurrentUser method and Now() function to
log the name of the user and the date/time of the last modification
right in the form's recordset after a record is updated. However, a
more elegant approach would be to write some DAO code to create a new
record on a separate table every time the record is updated. Again,
this is accomplished from the OnDirty event.

Alexandre Bejerman
Montreal, Canada
Nov 27 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by stan | last post: by
11 posts views Thread by Dennis Marks | last post: by
4 posts views Thread by IdleBrain | last post: by
1 post views Thread by mich dobelman | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.