I am trying to figure out how to create a "simple" audit trail on a table in Access 2007. What I would like to capture is: the date/time information changed, the username of the person who changed it, and the field that changed.
I don't need to capture the data that changed, as I have that in several other places for important information (Comments, due dates, etc)
what I have so far is on the form AfterUpdate event: Set rs = CurrentDb.OpenRecordset("Audit") With rs .AddNew !tblProject_ID = Me.ID !last_update = Now() !updated_by = fOSUserName() !FieldName = Field.Name .Update End With
The only thing that I can't get to populate is the FieldName part. the date/time, and username work as well as the ID portion to link back to the main table.
How can I get Access 2007 to tell me WHAT field changed on this form? I guess the other problem that would come up is if multiple fileds change in one session.
Any help would be appreciated!
|