checking whether a record has been dirtied in the last 60 secs

J

John Baker

Is it possible to check that a record on a form has been dirtied in a the
last lets say 60 seconds. I have a form which usually sits on the same
record for most of the day. I want to check if a record has been changed
recently as opposed to being changed earlier in the day. I am thinking of
using the timer event and the ondirty event.

Any help greatly appreciated.

John Baker
 
D

Dale Fye

You could use the forms timer event to test the value of the controls after
some specified time interval.

I would probably create a user defined data type to store the values of all
the fields in the form in the forms current event. Then, in the timer
event, loop through each of the controls and compare its value to the values
in your data type. If something has changed, retain the change in the user
defined data type, and set the value of some variable (LastChange) as NOW().

If the form sits on the same record for most of the day, who would make
changes to the values on this form? Wouldn't they know when they made
changes? Or is the data accessable by others? If it is, then you need to
put some code in the forms timer event to refresh the RecordSource every so
often anyway, so that you will see the changes that other users make to the
data.

HTH
Dale
 
Top