I have tried several Audit Trail examples provided from the internet and can't get any of them to work. I just need simple code to audit all changes, "New", "Delete" and "Edit" of records. I'd prefer it to audit a table, but can use a form is it is necessary. Are there any 'real' sample databases to download to look at? I'm pretty quick learning of code and understanding Excel and Access. I have created a simple table named "List" with CustomerID, FirstName, and LastName. Created a table named tbleAuditTrail with ChangeID, DateTime, UserID, FormName, FieldName, OldValue, NewValue, Action, and RecordID. (notice I do have FormName because the internet example was using a form)
Currently I am getting error code message Compile Error: ByRef argument type mismatch...how can I fix it?
It is the module code for the Beforedate:
Private Sub Form_BeforeUpdate(Cancel as Integer)
On Error GoTo Handler
If Me.NewRecord Then
call AuditChanges("CustomerID", "NEW")
else
call AuditChanges(CustomerID", "EDIT")
End If
Exit Sub
errHandler:
msgBox "Error " & Err.Number & ": " & Err.Description & " in " & _
VBE.ActiveCodePane.CodeModule, vbOKOnly,"Error"
End Sub