Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

record field name on dirty

Posted on 2011-02-15
4
Medium Priority
?
555 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 2000 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

916 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