Advice on best method

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,347
Office Version
  1. 365
Platform
  1. Windows
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.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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.
 
Upvote 0
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.)
 
Upvote 0

Forum statistics

Threads
1,223,703
Messages
6,173,941
Members
452,539
Latest member
delvey

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top