stevbe
asked on
Audit Trail / History
Hello Experts,
I realize that this question has been asked and answered many times and I am aware of the different approaches previously suggested but I think I have a fresh approach and would like to hear everyone's thoughts.
Basically I will be using a class object to register my forms with that will hook the AfterUpdate, AfterInsert, AfterDelete events and write the data along with a timestamp to a seperate History database.
I already have a function called myOpenForm which is a wrapper around the DoCmd.OpenForm that adds the form to the myForm and myForms classes and then calls the DoCmd.OpenForm. I can expand the myForm class to hook the events and write to history but am thinking that I need the equivalent of a Msys table to track which forms I need to track history on and I think I am going to need to write additional code to see if the form has subforms and adds them to the myForm / myForms class tree.
I am still in the early stages of thinking about this and wonder if I should expand to having myControl and myControls classes tree'd to the myForm class so I can iterate values and only write history if there really was a change or if the .Value and .OldValue going to give accurate returns?
TIA,
Steve
I realize that this question has been asked and answered many times and I am aware of the different approaches previously suggested but I think I have a fresh approach and would like to hear everyone's thoughts.
Basically I will be using a class object to register my forms with that will hook the AfterUpdate, AfterInsert, AfterDelete events and write the data along with a timestamp to a seperate History database.
I already have a function called myOpenForm which is a wrapper around the DoCmd.OpenForm that adds the form to the myForm and myForms classes and then calls the DoCmd.OpenForm. I can expand the myForm class to hook the events and write to history but am thinking that I need the equivalent of a Msys table to track which forms I need to track history on and I think I am going to need to write additional code to see if the form has subforms and adds them to the myForm / myForms class tree.
I am still in the early stages of thinking about this and wonder if I should expand to having myControl and myControls classes tree'd to the myForm class so I can iterate values and only write history if there really was a change or if the .Value and .OldValue going to give accurate returns?
TIA,
Steve
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, I have WithEvents working fine :-)
You already did - or you have now?
/gustav
/gustav
ASKER
I have been using With Events for a few years.
ASKER
I am only interested in tracking data history not objects.
The code from the link you posted would require I write code in and for all my forms and have seperate variables for every field, this is way more work and maintenance than I think is necessary.
Can you give me your thoughts on my proposed process?
Thanks,
Steve