Marshall Brooks
Member
- Local time
- Today, 14:25
- Joined
- Feb 28, 2023
- Messages
- 696
@jdraw - Thank you - I'll look at your example later, but I was using your example database from the linked thread above: Reply #41, and thought I understood them.
I have a quick question:
I'm not sure I understand the concept of the AfterInsert, AfterUpdate, and AfterDelete "triggers". If I understand correctly, I think I only need to look at AfterUpdate. If AfterInsert is when a new record is created, the fields I am tracking would be intially and for some time afterward blank, so I don't care about tracking changes. If AfterDelete is when a record is deleted, I don't care either. If the deletion was intentional and correct, the record is gone and I don't care about the tracking history. If the deletion was incorrect, I will want to restore ALL the fields from the backup and therefore also don't care about the audit history - although it could be useful to verify when and by whom the record was deleted.
Next week, if I can't figure it out from your attachment, I'll try to work incrementally - i.e. I'll use a new macro with an action such as "Display a MsgBox "DM Fired" for the after update event. Then move that to show a msgBox if the specific field changed, then write text to the tblAuditLog Field if the field changed.
If I'm still stuck, I'll create a demo DB and post that.
Thanks again!!!
I have a quick question:
I'm not sure I understand the concept of the AfterInsert, AfterUpdate, and AfterDelete "triggers". If I understand correctly, I think I only need to look at AfterUpdate. If AfterInsert is when a new record is created, the fields I am tracking would be intially and for some time afterward blank, so I don't care about tracking changes. If AfterDelete is when a record is deleted, I don't care either. If the deletion was intentional and correct, the record is gone and I don't care about the tracking history. If the deletion was incorrect, I will want to restore ALL the fields from the backup and therefore also don't care about the audit history - although it could be useful to verify when and by whom the record was deleted.
Next week, if I can't figure it out from your attachment, I'll try to work incrementally - i.e. I'll use a new macro with an action such as "Display a MsgBox "DM Fired" for the after update event. Then move that to show a msgBox if the specific field changed, then write text to the tblAuditLog Field if the field changed.
If I'm still stuck, I'll create a demo DB and post that.
Thanks again!!!