Results 1 to 4 of 4
  1. #1
    vad77 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2013
    Location
    USA
    Posts
    101

    Question Audit Trail in Access 2016 64 bit

    Does anyone know if there is an updated version of the Audit Trail code from this link, http://allenbrowne.com/AppAudit.html


    Have been using this for years and it has work with no issues. I now Office 2016 64 bit and I get a compile error with the code in the module.

    Compile Error:

    The code in this project must be updated for use on 64 bit systems.
    Please review and update Declare statements and then mark them with the PtrSafe attribute.


    Private Const conMod As String = "ajbAudit"
    Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
    "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long


    If anyone can help in correcting this code it will be greatly appreciated.

    Thank you.

  2. #2
    Mickjav is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2019
    Location
    Margate, Kent
    Posts
    123
    Private Declare PtrSafe Function apiGetUserName Lib "advapi32.dll" Alias _
    "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

    If The Above don't work try

    Private Declare PtrSafe Function apiGetUserName Lib "advapi32.dll" Alias _
    "GetUserNameA" (ByVal lpBuffer As String, nSize As LongPtr) As Long

    Hope it helps
    mick

  3. #3
    vad77 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2013
    Location
    USA
    Posts
    101
    Mick,

    Thank you, the first line of code worked.

  4. #4
    Mickjav is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2019
    Location
    Margate, Kent
    Posts
    123
    If you want it to work in both use this
    #If VBA7 Then
    64bit Compiled Versions
    #Else
    32Bit Compiled Versions
    #End If

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

Similar Threads

  1. Replies: 2
    Last Post: 08-28-2018, 10:38 AM
  2. New to Access, need help setting up an audit trail
    By kwp6353 in forum Programming
    Replies: 6
    Last Post: 01-12-2017, 08:11 AM
  3. Access 2010: Audit Trail not Working in Subform
    By besuchanko in forum Programming
    Replies: 19
    Last Post: 11-12-2015, 03:47 AM
  4. Replies: 1
    Last Post: 09-01-2015, 02:01 PM
  5. Replies: 2
    Last Post: 02-09-2013, 12:39 PM

Tags for this Thread

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