Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple user database problem

Status
Not open for further replies.

jospe1

Programmer
Joined
Oct 9, 2002
Messages
4
Location
US
I have an access database that is being used by multiple people. I need a way to track who is making updates, what updates they are making and when they are making them. The database is already set up to track who is using it, based on login. Any help or suggestions are greatly appreciated.
 
Here is an idea that I haven't tested. You could use the variables sChange, sUser, and chgDate in an INSERT SQL statement to update a history table.

Sub LogChanges(frm As Form)

i As integer
sChange As String
sUser As String
chgDate As Date
sName As String
Dim sChanges As String

If frm.IsDirty Then
For i = 0 To frm.Controls
If frm.Controls(i).OldValue <> frm.Controls.Value Then
sFormName = frm.Name
sControlName = frm.Controls(i).Name
sChange = frm.Controls(i).OldValue
sUser = CurrentUser
chgDate = Now()
sChanges = &quot;Form: &quot; & sFormName & &quot; &quot; _
& &quot;Control: &quot; & sControlname & &quot; &quot; _
& &quot;User: &quot; & sUser & &quot; &quot; _
& &quot;Date: &quot; & chgDate & &quot; &quot; _
& &quot;OldValue: &quot; & sChange & vbCrLf
End If
Next i
End If

End Sub ----------------------
scking@arinc.com
Life is filled with lessons.
We are responsible for the
results of the quizzes.
-----------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top