Hi everyone,
Happy to write my first post in the forum (after introduction)
I have an audit trail macro that loops through controls in a form and writes a change log table (I borrowed the code from techrepublic) However, while the macro works perfectly with forms without subforms I get type mismatch error in the only form that includes 2 subforms. I believe that if I am able to stop the macro from looping through the subform controls the error could go away.
At the moment the code is the following
Is there a way to change this to be For each control in form excluding subforms?
Btw, the macro is called in the following way
Thanks!
Happy to write my first post in the forum (after introduction)
I have an audit trail macro that loops through controls in a form and writes a change log table (I borrowed the code from techrepublic) However, while the macro works perfectly with forms without subforms I get type mismatch error in the only form that includes 2 subforms. I believe that if I am able to stop the macro from looping through the subform controls the error could go away.
At the moment the code is the following
Code:
For Each ctl In frm.Controls [...]
Is there a way to change this to be For each control in form excluding subforms?
Btw, the macro is called in the following way
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Call AuditTrail(Me, Me.launch)
End Sub
Thanks!