Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Baker - 03 May 2005 00:30 GMT
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
Marshall Barton - 03 May 2005 01:00 GMT
>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.

The Dirty property will tell you if the record is dirty.
However, the Dirty property, not the Dirty event will tell
you if the record has been changed again recently.  You
would need to use every bound control's AfterUpdate event to
set a time variable.

You can use the form's AfterUpdate event to set a flag
variable to indicate that the record was changed and saved.
So, even if the form is not dirty, you can tell if it was
dirty recently.

Unfortunately, the user can undo any changes without you
finding out about it.

Signature

Marsh
MVP [MS Access]

Dale Fye - 03 May 2005 02:44 GMT
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

> 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
[quoted text clipped - 5 lines]
>
> John Baker
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.