Solved

record field name on dirty

Posted on 2011-02-15
4
546 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
  • 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

746 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now