@jdraw - Basically all of your points have been considered ... (And fortunately, we are early on in the process ...)
-you seemed adamant that you only needed basic info for after update--now this has changed??
No, it hasn't changed. As I said initially, the
need/requirement is for audit info when a field changes. The
want/desire would be nice to have a record in the table when a record is added or deleted - with or without a field change. (Partly b/c we have had previous issues with records disappearing and/or being copied over. I have both working now with your help.)
-it is time to get clarity on what exactly is the purpose of/for your audit table.
Essentially, we have date fields in the database for completion steps in our process. We don't have information on Who entered the data for the completion steps or when the data was entered. We have PDF files that are signed and retained separately from the database to also track the completion steps. The idea is get rid of the PDF files and use the database to track/record/audit the completion steps.
What is required is not determined by the co-worker familiar with SQL. The SQL person may help with HOW the WHAT gets implemented.
I never said anything otherwise. The co-worker speaks SQL. I speak VBA. The main difference is with the co-worker, I can say "Here's my database - how would I do this?" And as
@Minty said, he basically said "Well, you could go with a left Join in your WHERE statement in your SQL query", which went somewhat over my head. The advantage of the co-worker over asking on here, is I don't have to say "I have a table, but it's really called something else, and it has these fields, but they aren't the real names, and I want to do this, but I don't know how, so when you reply back, I'll convert the created names for the real names and hopefully it will work."
-if you have an authoritative table that relates user login info to actual names, then you can that in combination with your GetUserName type of function to get the value (whatever you need--research the requirement) to record in the tblAuditLog.
Yes, I found a glitch in the matrix this morning and two possible workarounds. I have an authoritative table that relates CURRENT login info to actual names. I usually remove people from the table when they leave the company/department. So let's say Joe Smith is ab12345. He leaves the company. If the table pulls from my lookup table, the tblAudit says Joe Smith made the change 5 years ago. Okay, he was here then, makes sense. If the record is gone from my lookup table, the tblAudit says ab12345 made the change and nobody knows who that is, and if he left the company, he won't show up in any of our global searches either. HR
should have a record that they could cross-reference, but I wouldn't want to tell an auditor "I think ab12345 is Joe Smith, but he's not working here anymore, I'll have to verify with HR and get back to you on that."
Workaround 1 is to record the real name in the tblauditresults - which probably means copying Elookup to the BE, but avoids all the SQL Join query issues.
Workaround 2 is to never delete entries from the table, but add an Active Employee Yes/No field and uncheck it when someone leaves.
-have you tried/tested using an update query to modify a record(s) in your tblSource. You'll find that such a change is recorded in the tblAuditLog.
We rarely do that, but one of the main reasons I wanted to go with DM for this is that often the fields might technically be updated via VBA rather than direct input by the user.
Thank you again for all of your assistance!