Advice on best method

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
1,690
I have a table with about 10 fields. What I am trying to do is keep track of data changes; What changed and when they change.

I am thinking that when the user wants to change data that they duplicate the record and then modify the duplicate record. I have fields that show date/userId so that part of it is not where I am looking for advice. Its if I should make the user first duplicate the record.... (Note: The users views/changes data via a form.)

Where I am a little unclear on the "duplicate" approach is how to keep the user from ever changing the prior/original "record". I would have to have it like a read only somehow.

Any suggestion is appreciated.
 

Some videos you may like

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

petertenthije

Board Regular
Joined
Sep 25, 2012
Messages
176
Re: Access: Advice on best method

I have a table with about 10 fields. What I am trying to do is keep track of data changes; What changed and when they change.

I am thinking that when the user wants to change data that they duplicate the record and then modify the duplicate record. I have fields that show date/userId so that part of it is not where I am looking for advice. Its if I should make the user first duplicate the record.... (Note: The users views/changes data via a form.)

Where I am a little unclear on the "duplicate" approach is how to keep the user from ever changing the prior/original "record". I would have to have it like a read only somehow.

Any suggestion is appreciated.
You could make an append query instead of an update auery. It would copy the contents of your form to a seperate table. This query could also include the username, computer ID, systemdate and -time.

You could either run this query through a ”save” button on the firm, or couple it to events. For instance when closing the form or leaving the row of data.
 

JonXL

Active Member
Joined
Feb 5, 2018
Messages
302
Office Version
365, 2016
Platform
Windows
Re: Access: Advice on best method

I would opt against this approach of duplicating records and use an audit table to track changes to records. The basic idea is that everytime you modify a record, a code runs to append the old and new values of the fields that changed to an audit table along with who, when, what field, the record ID, and some way to identify the record set (form or table name, for example).

When you want to see the changes, you can run a report on the form that filters the audit table for that record set and that record to show the history of each field and thus the record.

I use something similar to this:

http://www.iaccessworld.com/downloads/create-audit-trail-database/

Constant values (created dates) I store in a field on the record because they get displayed in the form and it's better not to have to query the huge audit table every time for that information. (Audit trails are very useful but seldom used.)
 

Forum statistics

Threads
1,089,229
Messages
5,407,015
Members
403,117
Latest member
redblasko

This Week's Hot Topics

Top