Solved

record field name on dirty

Posted on 2011-02-15
4
551 Views
Last Modified: 2012-06-21
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
0
Comment
Question by:4charity
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 11

Expert Comment

by:Runrigger
ID: 34897945
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
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 34897948
Me.Text2 = me.activecontrol.Name
0
 
LVL 11

Expert Comment

by:Runrigger
ID: 34897961
Of course!

Not sure of the capture logic though.
0
 

Author Closing Comment

by:4charity
ID: 34898149
Perfect. I did add:
Me.Dirty = False
at the end of the code, to make it record.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question