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.
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.
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.
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
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?
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
You can set an option to have them added to every NEW module.Code:Option Compare Database Option Explicit
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
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.
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.
I was able to correct the problem. Thanks for the help. It is working now.
Excellent!! Happy to help....
Can you post the database that has everything working?
Seems the 1 in post 7 is not working based on your post.
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.
One more thing....
I would change these 3 lines (two places) in "Function AuditTrail"
toCode:DoCmd.SetWarnings False DoCmd.RunSQL sSQL DoCmd.SetWarnings True
Code:CurrentDb.Execute sSQL, dbFailOnError
but that is just me.
Good luck with your project......
Thank you so much. That works perfectly.