Results 1 to 2 of 2
  1. #1
    conjohn is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    1

    Audit Trail

    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

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    What does the function look like? If I had to guess, it's expecting a numeric value instead of text.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Audit Trail Help
    By HelpDesk in forum Access
    Replies: 9
    Last Post: 08-07-2015, 06:13 AM
  2. Audit Trail
    By zburns in forum Access
    Replies: 4
    Last Post: 07-27-2015, 08:49 AM
  3. Having an audit trail
    By ryanmce92 in forum Modules
    Replies: 5
    Last Post: 06-03-2015, 02:29 PM
  4. Replies: 2
    Last Post: 02-09-2013, 12:39 PM
  5. audit trail
    By slimjen in forum Forms
    Replies: 1
    Last Post: 10-13-2011, 01:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums