Hi,
I'm creating a database and I need to find a way to track the changes to a record, more exactly, I need to know who makes changes to each record, as the users can only modify their own records.
I have one table where all the data is stored and I have between 50-100 users. Due to the high number of users, I would like to use the Windows login user ID instead of having to create user ID in Access. Is it possible? If yes, what is the code to be able to get the information (who changed the record) added to my table?
Thank you!
Marie
2 9266
Hi,
I'm creating a database and I need to find a way to track the changes to a record, more exactly, I need to know who makes changes to each record, as the users can only modify their own records.
I have one table where all the data is stored and I have between 50-100 users. Due to the high number of users, I would like to use the Windows login user ID instead of having to create user ID in Access. Is it possible? If yes, what is the code to be able to get the information (who changed the record) added to my table?
Thank you!
Marie
Marie, you can create a Log File that Tracks which Logged User made changes to data in a specific Form, at a give Date and Time, and it will also list the Primary Key Number of the Record that was changed. Copy and Paste the following Sub-Routine in a Standard Code Module. In its simplest Format, it will create a Log File in C:\Changes.txt that will list the changes made in order. Place the Sub Procedure Call in the AfterUpdate() Event of any Form for which you want to track data modifications: -
Public Sub TrackChanges(strUser As String, frmName As String, lngPrimaryKey)
-
Dim Msg As String
-
-
Msg = Format$(Now(), "dddd, mm/dd/yyyy hh:mm AM/PM") & " - "
-
Msg = Msg & strUser & " made changes to data in Form " & frmName
-
Msg = Msg & " - {Primary Key Number " & lngPrimaryKey & "}"
-
-
Open "C:\Changes.txt" For Append As #1
-
Print #1, Msg
-
-
Close #1
-
End Sub
-
Sample Call to the Sub-Routine -
Private Sub Form_AfterUpdate()
-
Call TrackChanges(CurrentUser(), "frmEmployee", Me![PrimaryKey])
-
End Sub
-
Sample from C:\Changes.txt -
Thursday, 11/08/2007 10:39 PM - Admin made changes to data in Form frmInventory - {Primary Key Number 74}
-
Thursday, 11/08/2007 11:48 PM - John Doe made changes to data in Form frmEmployee - {Primary Key Number 98774}
-
Friday, 11/09/2007 08:05 AM - Bart Simpson made changes to data in Form frmInvoice - {Primary Key Number 876}
-
NOTE: The above code was listed only as a simple Template, make your own changes to suit your specific needs.
Hi,
I'm creating a database and I need to find a way to track the changes to a record, more exactly, I need to know who makes changes to each record, as the users can only modify their own records.
I have one table where all the data is stored and I have between 50-100 users. Due to the high number of users, I would like to use the Windows login user ID instead of having to create user ID in Access. Is it possible? If yes, what is the code to be able to get the information (who changed the record) added to my table?
Thank you!
Marie
Hello Marie,
Take a look at my blog entry Tracking changes in Access
this should do what you need.
Bill Mitchell
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Nicole |
last post by:
Hello:
I have a shared database running on a network drive. I would like to
track when record changes occur and who did it.
Problem 1: I'm not able to tack changes, when they occur in...
|
by: Uwe Range |
last post by:
Hi to all,
I am developing a database where, with time, it proved to be necessary
to keep track of the changes to the data. It is fairly easy to keep
track of the time when a record was changed...
|
by: Gomez |
last post by:
I have set up two tables ****current and ****history.
The history table contains all the fields which I want to track changes
on. The current table contains just the most recent information from...
|
by: strvariant |
last post by:
Hi all,
I am searching for a way to track when a form/report/query is changed by
users. For instance:
1) A user opens a form/report
2) The user enters the Design mode of that form/report
...
|
by: Charles Law |
last post by:
Here's one that should probably have the sub-heading "I'm sure I asked this
once before, but ...".
Two users are both looking at the same data, from a database. One user
changes the data and...
|
by: mankolele |
last post by:
Hi all
Is there someway to track changes made to data in a mysql database?
Like someone changes a phone number in a record on a form -Is there a way to find out what changes were made to what...
|
by: De_Cisse |
last post by:
Hi all,
I'm working on an application in which I already make some
preparations to be able to work in a frontend and backend database,
even if this isn't the issue a this moment. I'm using VBA...
|
by: John Sheppard |
last post by:
Hello there,
Does anyone know of a way to track changes to an SQL Server database so that
I can easily run those changes at a later date?
That is, I want to make schema changes, and record...
|
by: dirksza2009 |
last post by:
Hi,
I've made a multi user (4 end users) database in Access 2000. I've made data tables, reference tables etc which sits on a shared drive and I've made individual front ends for the end users...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |