Checking for No changes to Retreived Records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I check if there have been "no changes" after retrieving a record and
before quitting a form?

Basically, I have a quit button that executes an Undo before closing the
form. I want to check first to see if there have indeed been changes, and if
so, then execute the undo, else close the form.

Any ideas?

Thanks,
Leslie
 
Why are you doing this? You want to cancel any changes? Just don't allow
any changes in the first place. In the form's property box set the ALLOW
EDITS to false.
 
Rick,

Thanks, I'll look at Dirty.

Per your second post, I am in a screen that allows all functionality --
adds, edits, record retrievals, and deletes. Trying to keep it simple for
the End User, so indeed, I want to allow edits, I just need to check if an
edit has been done so I don't give an "extra" error message that is just
annoying to the end user when I execute an Undo when nothing has changed.

Cheers,
Leslie
 
Leslie said:
Rick,

Thanks, I'll look at Dirty.

Per your second post, I am in a screen that allows all functionality
-- adds, edits, record retrievals, and deletes. Trying to keep it
simple for the End User, so indeed, I want to allow edits, I just
need to check if an edit has been done so I don't give an "extra"
error message that is just annoying to the end user when I execute an
Undo when nothing has changed.

Be aware that you would need to do this "per record" not "per form session"
which would mean using the BeforeUpdate event. If you use the Close event
of the form the user could open the form and change 50 records and if they
then closed the form after edting the 50th record your code would only be
able to undo that last change to the 50th record. The other 49 changes will
already have been committed at that point.

I find it better to simply lock the form and provide an [ Edit ] button that
unlocks it. Since the user has to explicitly unlock the form before making
changes there is no longer any reason to bother him with a "Did you do that
on purpose?" prompt.
 
Rick,

Thanks for the info. I am doing a similar kind of deal where the person has
to actually look the record up with the intention to edit the record. I am
processing on a record-by-record basis -- no group updates.

It looks like I will be able to make the Dirty functionality work for me.

Thanks again for pointing me in the right direction.

Cheers,
Leslie



Rick Brandt said:
Leslie said:
Rick,

Thanks, I'll look at Dirty.

Per your second post, I am in a screen that allows all functionality
-- adds, edits, record retrievals, and deletes. Trying to keep it
simple for the End User, so indeed, I want to allow edits, I just
need to check if an edit has been done so I don't give an "extra"
error message that is just annoying to the end user when I execute an
Undo when nothing has changed.

Be aware that you would need to do this "per record" not "per form session"
which would mean using the BeforeUpdate event. If you use the Close event
of the form the user could open the form and change 50 records and if they
then closed the form after edting the 50th record your code would only be
able to undo that last change to the 50th record. The other 49 changes will
already have been committed at that point.

I find it better to simply lock the form and provide an [ Edit ] button that
unlocks it. Since the user has to explicitly unlock the form before making
changes there is no longer any reason to bother him with a "Did you do that
on purpose?" prompt.
 
Back
Top