Results 1 to 5 of 5
  1. #1
    zburns is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    39

    Audit Trail

    I'm trying to incorporate the Audit Trail as shown by Martin Green http://www.fontstuff.com/access/acctut21.htm
    The audit table is working fine but I'm having a problem matching up the audit recordID field with the underlying table ID field in a meaningful way. How do I join both tables in a query so that I can add a field from the underlying table to help identify the record.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,892
    What is the recordID field? If it is an autonumber then cannot link on this field. If this is a number field for saving the ID from the original table record, should be a simple join in query. The original ID field and the audit table RecordID field must be the same data type for linking in query (autonumber PK links to number FK).
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    zburns is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    39
    The original ID field is autonumber and audit table recordID field type was set up as text as recommended and that is where the type mismatch occurs. Is there any way around this?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,892
    I suppose Martin recommends text to handle any type of original primary key. However, cannot join datasets on different data types. Possible options:

    1. if you know the audit field will always receive a number value from a number type primary key, then set the field as number type, no idea what adjustment might be needed in code

    2. build a query of the original dataset that casts the PK to a text type then join that query to the audit table - Format(ID, "@")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    zburns is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    39
    Worked out fine. Thanks

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

Similar Threads

  1. Having an audit trail
    By ryanmce92 in forum Modules
    Replies: 5
    Last Post: 06-03-2015, 02:29 PM
  2. Audit Trail into Subform
    By AdamMVRRS in forum Access
    Replies: 10
    Last Post: 02-07-2014, 10:16 AM
  3. Replies: 2
    Last Post: 02-09-2013, 12:39 PM
  4. Audit Trail
    By bigroo in forum Programming
    Replies: 4
    Last Post: 02-22-2012, 07:55 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