1
1
I got Richard Rensel's modification for MS KB audit trail. Great! But:
Trailing is stored in each table's update field. Updating memo fields and
copy-pasting changes in the update field (which is a memo field) quickly the
update field runs out of space. So I thought of a second approach that would
make everyone's life easier.
1) Wouldn't it be better to have a table solely for storing data changes in
all tables?? Something like:
Table name:
AuditTrails
Fields:
TrailID PK
DateTime Now() (date/time of operation)
VerNum Integer (Version Number)*1
VerDate date (Version Date)*1
Action New,Update,Delete.. (Action performed)
Table (table to which change
is made, calling form's recordsource)
Field (field to which change
is made, calling control's recordsource)
Record (RecordID (PK) to which
change is made)
Value (Historic value, aka
value before update)*2
User (User that made the
changes)
*1 Each table contains two fields: VerNum and VerDate hold an incremental
number in the first, and the date the last change was made in the second,
thus when a change is made, the VerNum & Verdate from the record are copied
to the audittrail table's corresponding fields.
*2 Guessing that "changed to" is not needed because the updated record
reflects the updated entry.
2) Also, having a button "show Changes History" would query the audittrails
table with a filter set to the current form's recordsource.
3) Wanting to use the code for versioning control, the ability to have a
"rollback to previous version" function would be GREAT!! For that, the
action would be recorded as RollBack.
Trailing is stored in each table's update field. Updating memo fields and
copy-pasting changes in the update field (which is a memo field) quickly the
update field runs out of space. So I thought of a second approach that would
make everyone's life easier.
1) Wouldn't it be better to have a table solely for storing data changes in
all tables?? Something like:
Table name:
AuditTrails
Fields:
TrailID PK
DateTime Now() (date/time of operation)
VerNum Integer (Version Number)*1
VerDate date (Version Date)*1
Action New,Update,Delete.. (Action performed)
Table (table to which change
is made, calling form's recordsource)
Field (field to which change
is made, calling control's recordsource)
Record (RecordID (PK) to which
change is made)
Value (Historic value, aka
value before update)*2
User (User that made the
changes)
*1 Each table contains two fields: VerNum and VerDate hold an incremental
number in the first, and the date the last change was made in the second,
thus when a change is made, the VerNum & Verdate from the record are copied
to the audittrail table's corresponding fields.
*2 Guessing that "changed to" is not needed because the updated record
reflects the updated entry.
2) Also, having a button "show Changes History" would query the audittrails
table with a filter set to the current form's recordsource.
3) Wanting to use the code for versioning control, the ability to have a
"rollback to previous version" function would be GREAT!! For that, the
action would be recorded as RollBack.