Results 1 to 13 of 13
  1. #1
    Delfina is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Jan 2019
    Location
    Bartlesville OK
    Posts
    47

    Audit Trail - Not Working

    Sample Database 2.zip

    I am having issues with getting my Audit Trail to work. I have attached it. Please let me know if I need to post the code in this site rather than just attaching the database. I would appreciate any help I can get with this.

  2. #2
    Delfina is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Jan 2019
    Location
    Bartlesville OK
    Posts
    47
    Please take into consideration that I this is a work in progress. Something I am learning with. I have not yet got everything in there.

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    And the issues are? I fixed a small issue in your module and it seems to work for me now. Can you please have a look and confirm?

    Cheers,
    Vlad
    Attached Files Attached Files

  4. #4
    Delfina is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Jan 2019
    Location
    Bartlesville OK
    Posts
    47
    Hello! I just got home from work. It works on the projects form but not the provider form. I do not know what I am doing wrong. And is it possible to get it to work on the Login form?

  5. #5
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I took a quick look at your dB.

    There are several things that should be changed/fixed before moving on.
    You have used several reserved words as object names.
    Examples are
    "Field" and "User" in table "Audit"
    "Index" and "State" in table "Projects
    "Type" in table "Zip Code Results"
    See http://allenbrowne.com/AppIssueBadWord.html


    You are using spaces and special characters in object names.
    Object names should be only letters and numbers.
    Do not begin an object name with a number.
    NO spaces, punctuation or special characters (exception is the underscore) in object names
    Examples:
    "Entry Date & Time" - better would be "EntryDateTime" or "Entry_Date_Time"
    "E-mail Address" - better would be "EMailAddress", "E_mailAddress" or "E_mail_Address"


    EVERY code module should have these two lines at the top
    Code:
    Option Compare Database
    Option Explicit
    You can set an option to have them added to every NEW module.
    In the IDE, go to TOOLS/Options. In the EDITOR tab, click "Require Variable Declaration"
    Having Option Explicit will also help find errors in the code when you do a compile (Debug/Compile)



    In table "Projects", what are the fields "Active" and "Inactive"? Can a record be Active AND Inactive at the same time?
    Maybe change the field to "IsActive" (no quotes).
    If checked (TRUE), then active. if not checked (FALSE), then Inactive. Wouldn't need the 2nd field.



    For audit trail info and code, see Creating an Audit Log

  6. #6
    Delfina is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Jan 2019
    Location
    Bartlesville OK
    Posts
    47
    Thank you so much for looking at this for me. I went over the things you said and I will make some changes tomorrow when I get home from work. I really do want to learn and everyone is being so helpful. Goodnight.

  7. #7
    Delfina is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Jan 2019
    Location
    Bartlesville OK
    Posts
    47
    I have made changes and I still don't know what I am doing wrong. I have read the information. Something is not clicking with me.
    Attached Files Attached Files

  8. #8
    Delfina is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Jan 2019
    Location
    Bartlesville OK
    Posts
    47
    I was able to correct the problem. Thanks for the help. It is working now.

  9. #9
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Excellent!! Happy to help....

  10. #10
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Can you post the database that has everything working?
    Seems the 1 in post 7 is not working based on your post.

  11. #11
    Delfina is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Jan 2019
    Location
    Bartlesville OK
    Posts
    47
    I have redone this a dozen times since we had our last chat. I do not have the things that you helpws me with in this one yet. I will. I am going to redo the projects form and put the dropdown box that fills in the unbound text boxes that populates the table that you helped me with. That works great.
    Attached Files Attached Files

  12. #12
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    One more thing....
    I would change these 3 lines (two places) in "Function AuditTrail"
    Code:
            DoCmd.SetWarnings False
            DoCmd.RunSQL sSQL
            DoCmd.SetWarnings True
    to
    Code:
            CurrentDb.Execute sSQL, dbFailOnError

    but that is just me.



    Good luck with your project......

  13. #13
    Delfina is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Jan 2019
    Location
    Bartlesville OK
    Posts
    47
    Thank you so much. That works perfectly.

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

Similar Threads

  1. Access 2010: Audit Trail not Working in Subform
    By besuchanko in forum Programming
    Replies: 19
    Last Post: 11-12-2015, 03:47 AM
  2. Having an audit trail
    By ryanmce92 in forum Modules
    Replies: 5
    Last Post: 06-03-2015, 02:29 PM
  3. Replies: 2
    Last Post: 02-09-2013, 12:39 PM
  4. Audit Trail for SubForms Not Working
    By PinkNinja in forum Access
    Replies: 6
    Last Post: 01-07-2011, 11:03 PM
  5. Audit trail not working on form with subform
    By jpkeller55 in forum Access
    Replies: 52
    Last Post: 01-07-2011, 12:39 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