[AccessD] Preventing App Shut Down and Pop Up Forms

Stuart McLachlan stuart at lexacorp.com.pg
Thu Jun 18 18:03:01 CDT 2009


A slight correction. You can't cancel the Close action on a form.

It is the Unload event that you need to cancel if the variable is false.

-- 
Stuart

On 18 Jun 2009 at 22:25, Max Wanadoo wrote:

> Yes Tony, you are quite correct here.
> You can also use this method to prevent the user from closing the last form
> (ie, the program) without the "permission" of the program.  You can probably
> guess how, but to spell it out, merely declare a variable in the form and
> set to false.  Don't allow the form to close while the variable is false.
> When all your "program requirements" have been met, set the variable
> (Boolean) to  true. Then when they try to close the form they can do so.
> 
> Max
> 
> 
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tony Septav
> Sent: 18 June 2009 21:58
> To: Access Developers discussion and problem solving
> Subject: [AccessD] Preventing App Shut Down and Pop Up Forms
> 
> Hey All
> To those of you that use "CancClose" to prevent user's from closing the 
> application by clicking on  the application Close (X) icon in the upper 
> right hand corner of the screen.  Make sure when you open a subform to 
> turn the (assuming your parent form = Modal True ) parent form Modal = 
> False. When you close the subform turn the parent form Modal = True. 
> Works like a dream and the user cannot crash the program.
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> -- 
> 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