[AccessD] Cancel the closing of a form

Dan Waters dwaters at usinternet.com
Tue Sep 4 17:13:32 CDT 2007


Once the changes have been saved to the table, the only way to undo the
changes is to change the record again back to the condition it was in to
begin with.

Instead, I'd use an unbound form.  Then keep track of the original values in
duplicate controls that are hidden.  Then you can do a comparison when the
Close button is pushed and the button's click event runs.  Based on the
comparison, you can offer your user the choices you want.

If you want to use the X in the upper right corner, you'll need to do the
comparison in the form's close event, and cancel that event if needed.

Dan

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
rusty.hammond at cpiqpc.com
Sent: Tuesday, September 04, 2007 4:59 PM
To: accessd at databaseadvisors.com
Subject: [AccessD] Cancel the closing of a form

I have a form that when I close it either from a close button on the form or
from the built in close button, I want to test if the current record has
changed.  If it has changed, I want to prompt the user to either Save the
record and go ahead and close the form, not save the record and close the
form, or not save the record and not close the form via a YesNoCancel
message box.

If I use the close event of the form testing for me.dirty doesn't work
because the record is already saved.

Is there any way to do this?

Rusty Hammond
IT Dept. - B-20
CPI Qualified Plan Consultants, Inc.
(620) 793-8473 ext. 416
rusty.hammond at cpiqpc.com


**********************************************************************
WARNING: All e-mail sent to and from this address will be received,
scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc.
corporate e-mail system and is subject to archival, monitoring or review 
by, and/or disclosure to, someone other than the recipient.
**********************************************************************
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com















































































































































































More information about the AccessD mailing list