Acess - Closing

  • Thread starter Thread starter Abay
  • Start date Start date
A

Abay

Hello ... is there a way to inhibit the use of the windows close option when
exiting Access. We have a number of applications that depend on the user
using the application exit button to quit as they have some procures that
are triggered by same.

As always any help on this is much appreciated.

Abay
 
Ensure that you have a form that's always open. In that form's Unload event,
put code that checks whether they've got there in the required manner (use a
global variable, for instance) If they haven't done what they needed to, set
Cancel = True, which will prevent the form from closing.
 
Ensure that you have a form that's always open. In that form's Unload event,
put code that checks whether they've got there in the required manner (use a
global variable, for instance) If they haven't done what they needed to, set
Cancel = True, which will prevent the form from closing.

Yes, but be careful with Globals - they are cleared using this
technique. We don't use long-term globals, unless they are wrapped in
a function that reloads them if they're empty.

We use a hidden field on that always-open form to track whether the
user has already confirmed (via the normal Exit button on the form)
that they really want to exit the application.

Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 
Armen Stein said:
Yes, but be careful with Globals - they are cleared using this
technique. We don't use long-term globals, unless they are wrapped in
a function that reloads them if they're empty.

We use a hidden field on that always-open form to track whether the
user has already confirmed (via the normal Exit button on the form)
that they really want to exit the application.

You're right: using a hidden field is a much better idea.
 
Back
Top