Access Application "Close Button"

  • Thread starter Thread starter Tony Chorley
  • Start date Start date
T

Tony Chorley

Is there any way the Access Application "Close Button" can
be disabled?

Please bear in mind that I'm not referring to the Close
Button on Form, Reports etc, but the Close Button on the
Shell.

Many thanks in advance.

Tony C.
 
Set the 'Close Button' property of your form to 'No'. It
sounds too simple to be true, but it is.
 
Yes. You are referring to the Access Application Close Button.

Create a global Boolean variable "fOKToClose".

If you have a Form that is *always* open when the database is running, use
the Unload Event. In this Event, check whether fOKToClose is True or False.
If it is False, cancel the event. The reason is that before Access can be
closed, it will need to close all open Forms. If you cancel the unloading
of the Form (and the Form remains open, subsequent actions will be cancelled
including closing Access application.

If you don't have aForm that stays open during normal running of the
database, use a dummy Form, open it (hidden if you want) as soon as the
database is opened.

For proper closing of the database, e.g. via a CommandButton, set fOKToClose
to True before closing Access. This will allow the Form_Unloading event to
go through.
 
Sorry Elwin, but you.ve mis-understood my requirement: -

I am talking about the "Close" button that appears in the
top RH Corner of MS Access, NOT the Close button on a
Form!!

Many thanks anyway

TC.
 
omg, I'm so embarassed, lol
-----Original Message-----
Sorry Elwin, but you.ve mis-understood my requirement: -

I am talking about the "Close" button that appears in the
top RH Corner of MS Access, NOT the Close button on a
Form!!

Many thanks anyway

TC.
.
 
I tested using AXP and Ctrl + F4 doesn't close the Form or the Access
Application.

--
HTH
Van T. Dinh
MVP (Access)


Derek Wittman said:
Van,
I've done this, too, and Dev's suggestion on The AccessWeb is precisely
what I did. Then, I set my menu bar as a custom one instead of the
(default) one. I've noticed that I can still close forms with Ctrl-F4. Is
this normal, or did I do something wrong?
 
Back
Top