Charlotte Foust
cfoust at infostatsystems.com
Mon Jun 23 12:03:26 CDT 2008
I don't believe you can cancel the form's close event. You have to use the Unload event instead if you want to cancel. However, a lot depends on how your close button behaves. If it just calls close, then a CancelEvent is not going to change that. If it calls Form_Unload and the Unload event calls DoCmd.Close, then the CancelEvent should work, I think. Charlotte Foust -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tony Septav Sent: Sunday, 22 June 2008 5:38 a.m. To: Access Developers discussion and problem solving Subject: [AccessD] Form BeforeUpdate Hey All I am trying to use the BeforeUpdate on a bound continuous form. The code works and checks the data in the current record for validation and if an error is found it pops up a message and fires the docmd.cancelevent (or cancel = true). Everything works fine, except when I click on the add, delete, or close buttons (mine) in the form's footer, then the code works fine and the message pops up, but the docmd.cancelevent doesn't fire. Is this a bug, or am I missing something. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com