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 = "Form: " & sFormName & " " _
& "Control: " & sControlname & " " _
& "User: " & sUser & " " _
& "Date: " & chgDate & " " _
& "OldValue: " & 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.
-----------------------