Creating Tracking system

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to find a way how to tracked changes in Access. What I'm trying to do is when a person signs is using a login name, can Access record any changes that make in Access.
thanks
 
Here is a previous post from Arvin Meyer.
Can you track the changes that are made to a record in
access? Does anyone know how to do this?

Yes. In the before update event of the form, grab the
OldValue property of each control and insert that value
into an audit table, together with the date\time of the
record change, and the username of the person doing it.
Here's one sample (aircode):

Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo Err_Handler

Dim lngItemID As Long
Dim strContractorID As String
Dim strSubdivision As String
Dim lngModelID As Long
Dim dblCost As Double
Dim dblCostCode As Double
Dim dtmEffectiveDate As Date
Dim db As DAO.Database
Dim strSQL As String

lngItemID = Me.txtItemID.OldValue
strContractorID = Me.txtContractorID.OldValue
strSubdivision = Me.txtSubdivision.OldValue
lngModelID = Me.txtModelID.OldValue
dblCost = Me.txtCost.OldValue
dblCostCode = Me.txtCostCode.OldValue
dtmEffectiveDate = Me.txtEffectiveDate.OldValue

Set db = CurrentDb

Me.txtLastUpdated = Now

strSQL = "INSERT INTO tblItemHistory ( ItemID,
Subdivision, ModelID,
CostCode, Cost, ContractorID, EffectiveDate )"
strSQL = strSQL & " VALUES (" & lngItemID & ", '" &
strSubdivision & "',
" & lngModelID & ", " & dblCostCode & ", " & dblCost & ", '" &
strContractorID & "', '" & dtmEffectiveDate & "');"
db.Execute strSQL

Exit_Here:
Exit Sub

Err_Handler:
MsgBox Error$
Me.Undo
Resume Exit_Here

End Sub

Jim
-----Original Message-----
I'm trying to find a way how to tracked changes in Access.
What I'm trying to do is when a person signs is using a
login name, can Access record any changes that make in Access.
 
1time said:
I'm trying to find a way how to tracked changes in Access. What I'm trying to do is when a person signs is using a login name, can Access record any changes that make in Access.

There's a simple example at
ACC2000: How to Create an Audit Trail of Record Changes in a Form
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q197592

Audit Trail - Log changes at the record level at:
http://users.bigpond.net.au/abrowne1/AppAudit.html
The article addresses edits, inserts, and deletes for a form and
subform.

Modules: Maintain a history of changes
http://www.mvps.org/access/modules/mdl0021.htm
The History Table routine is designed to write history records that
track the changes made to fields in one or more tables.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
Back
Top