I’m going to add a data element to our collection so that the user of our Form Auditor class will have the bound field name from the ControlSource property. First I will add a new test to check for this additional field in order to have a failing test, then I can write the code to make the test pass. Here goes:
My failing test:
The database compiles, and the test fails and produces a Run Time error that ControlSource is not a property of the FieldChanges collection.

Now it should be a simple exercise in adding the ControlSource Property to our AuditFieldChange object. That object is super simple, just containing public variant values, and here I have added the ControlSource property by adding it to the list:
Easy enough. Now I need to populate the ControlSource field in the FormAuditor object. I do that in a function called CreateAuditFieldChange and have added the line needed I think to do that:
This code is still failing, so I’m going to see what is actually being returned. I suspect Access adds an “=” in front of the string or something… I am about to look.
Actually, as I looked, I saw that the test passed. It’s a different test that is not passing. This is the test that I wrote to test whether the field changed by itself, or whether two fields bound to the same data would both trigger the change in the before update. I’ll think about this more in a post on another day.