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
4charityAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
peter57rConnect With a Mentor Commented:
Me.Text2 = me.activecontrol.Name
0
 
RunriggerCommented:
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.
0
 
RunriggerCommented:
Of course!

Not sure of the capture logic though.
0
 
4charityAuthor Commented:
Perfect. I did add:
Me.Dirty = False
at the end of the code, to make it record.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.