Solved BasAuditTrail VBA - Not working (1 Viewer)

Jordonjd

Member
Joined
Jun 18, 2020
Messages
96
Good morning Everyone,

I have a module I sourced from online, that inserts before and after values into an "Audit" table. Called from the before update event of the form and uses the format Call AuditTrail(Me, ID).

This works perfectly fine for every form I have used it on, until last night. A colleague uses a form to edit historical records in another front end and I thought I would add this function to the form.

But it is not working, as the record is updated, an error appears, "Operation is not supported for this type of Object, 3251"

The form was a split form with a subform, so I played around with removing the subform, creating a new form entirely, still the same error.

I have a form in my database using the same dataset and so i added the functionality to this, and it works fine.

The old tables do have some naming convention mistakes, for example a field called "+/-" (I have tried renaming this field in the query etc)

I also tried importing the module, forms and query into other db's to see if that had any effect.

I have attached a copy of the DB, if anyone has any suggestions about this it would be greatly appreciated.

The result i am after is that if any field is edited in the detail of the splitform Audit Trail is called and action the insert into the Audit Table.

Thanks!
 

Attachments

stepping through the code, the error message is generated by the modeltype.oldValue. Whether this is because the values are coming from a query I wouldn't like to say. stepping over that and then works for qty.
 
@CJ_London
@arnelgp

Thanks for the quick responses, and thanks for the edited code, that is beyond my knowledge so I would have never figured that out but i can see what you did so that is good.

Thanks!
 

Users who are viewing this thread

Top Bottom