Link to home
Start Free TrialLog in
Avatar of 4charity
4charity

asked on

record field name on dirty

I am trying to debug an issue I have on a form.
I would like to see which control on the form is being changed by the end-user, and record the name of that control in a text field when the form is actually changed.

I would like to set this on the Form Dirty Event, but not sure how to do it. I am also capturing the date and user on this Event. So far this is what I have:

Private Sub Form_Dirty(Cancel As Integer)
Me.Date1 = Now()
Me.Text = GetUserCredentials(2)
Me.Text2 = ???????????
End Sub
Avatar of Runrigger
Runrigger
Flag of United Kingdom of Great Britain and Northern Ireland image

Why capture on form dirty?

The easiest way to capture this would be to trap the "AfterUpdate" event on each control, and then call a routine to write the details you want to capture (passing through to the routine the name of the control being updated).

I am not aware of the Form_Dirty event capturing details of the control being changed, happy to be contradicted though.
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Of course!

Not sure of the capture logic though.
Avatar of 4charity
4charity

ASKER

Perfect. I did add:
Me.Dirty = False
at the end of the code, to make it record.