Tracking changes to an existing database

D

Derek

I am responsible for an already existing database that will have infrequent
updates/changes to the existing records. I would like to be able to keep
track of the dates when these changes occur. Is there anyway to make a field
that will automatically record the date each time a record is updated? Any
suggestions?
 
W

Wayne-I-M

Yes but this will over written if the record is changed again.

You need to create a table to store the details of the time/date when the
records was changed (and maybe by whom)

There are lot of post concerning this topic in the forum.

Use the google thingy to search as it better at it than MS

Search here
http://groups.google.com/advanced_search?q=&

Return only messages from the group at this location =
microsoft.public.access

good luck
 
P

PatHartman

Jet does not support triggers so the only way to make this happen is to
trigger it in a form event. ALL of my tables are always created with 4
tracking fields - CreateBy, CreateDt, UpdateBy, UpdateDt. The fields are
updated in the Form's BeforeUpdate event. This code needs to go in the
BeforeUpdate event of EVERY form that updates a table with the tracking
fields. You can create a class module if you know how to do that or you can
create a common module and pass in the form name so that you only need a
single line of code in each BeforeUpdate event. There are a number of
different ways from brute force to elegant.

If me.NewRecord Then
Me.CreateBy = Environ("UserName") --- there are other ways to populate
this
Me.CreateDt = Now()
End If
Me.UpdateBy = Environ("UserName") --- there are other ways to populate this
Me.UpdateDt = Now()

If you want an audit log, that's a lot more code. However, there are good
examples to be found is you search the internet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top