Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2537
  • Last Modified:

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
0
stevbe
Asked:
stevbe
  • 3
  • 2
2 Solutions
 
dannywarehamCommented:
Hey Steve.

From the sounds of it, you need something to not only track data changes, but object changes too...?
Is that right..?

Tracking data changes is quite simple (there's an example at www.mvps.org/access for tracking history). At the same site, there is also a way to trap an entry into unbound controls by usig globals.

I suppose the easiest way would be to have an OldValue and CurValue global, which is looped through when teh form is exited, and it's values appended/updated into a table.
0
 
stevbeAuthor Commented:
Thanks for you interest,

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
0
 
Gustav BrockCIOCommented:
You will probably need WithEvents for this.

Study the demos at John Colby's site:

  http://www.colbyconsulting.com

/gustav
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
stevbeAuthor Commented:
Thanks, I have WithEvents working fine :-)
0
 
Gustav BrockCIOCommented:
You already did - or you have now?

/gustav
0
 
stevbeAuthor Commented:
I have been using With Events for a few years.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now