On Dirty

G

Guest

I have used an On Dirty Event Procedure in a Form so that a date field is
automatically updated when any changes are made to a specific record. Could
any one tell me if I am likely to experience any implications as I am not
really aware of what "On Dirty" means.
Thanks for any help
 
L

Larry Linson

Roger Bell said:
I have used an On Dirty Event Procedure in a Form so that a date field is
automatically updated when any changes are made to a specific record.
Could
any one tell me if I am likely to experience any implications as I am not
really aware of what "On Dirty" means.

"Dirty" means that the value of some Control bound to a Field has been
changed while the Form has been displayed, but that the updated Record has
not been written back to the underlying Table. However, typing in exactly
the same information that is already in a Field will still fire the "Dirty"
event, so you might be resetting the date when there was no actual change in
the data.

A more accurate approach would be to compare Value and OldValue of each
Control in the Form's BeforeUpdate event and if any differ, set the
"DateLastChanged" Field.

Larry Linson
Microsoft Access MVP
 
M

Marshall Barton

Roger said:
I have used an On Dirty Event Procedure in a Form so that a date field is
automatically updated when any changes are made to a specific record. Could
any one tell me if I am likely to experience any implications as I am not
really aware of what "On Dirty" means.


You would be better off using the form's BeforeUpdate event.
It only fires when a record is about to be saved so, subject
to Larry's caveat, you don't have to worry about dealing
with the situation where a user modifies a field and then
uses Esc key to undo the change.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Clicking label makes Dirty property True 10
Dirty Me 6
Finding Dirty/Changed Controls??? 4
Dirty event not occur 5
how to find subforms not dirty ... 1
Dirty Event 2
Form Dirty 2
Form Dirty Property 1

Top