Audit Trail in Subform

IanMilly

Registered User.
Local time
Today, 07:19
Joined
Jun 1, 2004
Messages
46
Hi,

I am using the Aduit trail code (supplied by GHudson) Original thread

I am trying to use this code in a subform aswell, in the main form the changes are logged with no problem. In the subform the changes are not logged. How can i record the changes made in the subform?

Any help is appreciated.

Thanks

Ian
 
The essence of the solution is: implement your audit trail code on the sub-forms.

(Remember, sub-forms are only sub-forms when they're placed on another form. If you can get the audit trail to work on these "sub-forms" when they're used as "stand-alone" forms, then all *should* be well in "sub-form" state.)
 
I have the Audit trail function working perfectly in the "stand alone" form of the sub form. When the sub form is being used as is intended on a main form(as a subform) the changes are not being recorded.

Basically: When i make changes to data with the subform as a stand alone, all changes are recorded. When the subform is being used as part of main form the changes are ignored.

I have the form to call the audit trail function before update of the form.

Attached is a picture of the form(s) in both states

The audit trail function is being called on the main form to record any changes to that aswell. I don't believe this would cause a conflict.

Any ideas?

Thanks

Ian
 

Attachments

Have you seen the tip posted by "Lyn Mac" at the bottom of the first page of the ghudson thread?

This code worked for me. (It'd been so long, I'd forgotten about having to implement this "workaround".)
 
I am having similliar issues with creating the audit trail example in subforms. My biggest question is does this example work when a subform is created from a query? I can get the audit trail to work on a form that has a table for a source but not a query based form.
 
Yes - it does work for query-based forms (as all of mine are).
Just include the audit trail fields in the query.
 
I haven't seen this work on any of my subforms yet. I have included the auditrail in the query field.

I have made similiar sub forms using tables as the source and it works, however, I need to use queries so that I can do some expressional math to certain fields.

If you have a brief example of how yours work I would apprieate it.

Thanks.
 
In my case, I have included the audit fields on my form (visible = false).
The code that writes the audit info puts the values into those form fields.
This code is triggered by the Before Update event.
 
That seems like exactly what I have. I have 3 subforms on my main form. The audit trail works great for the main form, however, the subform audit trail does not report anything when you change the subforms. I have placed the audit trail info into the query that I use as source to the subforms and still nada.
 
Time to troubleshoot...

Is the audit trail code in the subforms being triggered at the appropriate time?

If yes, then are the audit trail variables being correctly assigned values?

If yes, then are the audit trail form fields being correctly populated by those variables?
 
I guess it is working, just not how I thought it should. It will only display the audit trail information when I am on the record that was changed. This is bothersome as I use the datasheet view for my subform. The audit trail information is not displayed in datasheet view.

Currently I am trying to figure out how to create a report that will tell the user of all the changes made via the primary key of the main form.

We will see...wish me luck
 

Users who are viewing this thread

Back
Top Bottom