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.
 

petertenthije

Board Regular
Joined
Sep 25, 2012
Messages
148
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
257
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,082,131
Messages
5,363,337
Members
400,726
Latest member
Shahzad Taimoor

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top