Quitting Access

  • Thread starter Thread starter Nick
  • Start date Start date
N

Nick

Allison, go in your form's properties. Under "Format", look for a field
called "Close Button". Set the property to "No", save your changes and
you're done.

HTH,

Nick
 
Hi,

I have a form with an exit button that logs people out of the application.
however if people press the X button to exit then it does not log them out
properly.

Is there a way to disable the Access X button for closing it down?
 
I don't think you can diable the windows X button. However, when Access
closes, it has to close all the forms first. You could add code in the
forms OnClose event to log the person out.

Kelvin
 
Thanks - I'll give that a go
Kelvin said:
I don't think you can diable the windows X button. However, when Access
closes, it has to close all the forms first. You could add code in the
forms OnClose event to log the person out.

Kelvin
 
Hi,

From the posts I'm a little unclear if you mean disabling
the form's "X" button or the main Access "X" button. If
you want to disable the main Access "X" button that's
pretty easy to do. I use these techniques. They work great.
Take your pick based on version.

ACC: How to Disable the Close Button (X) on the Access
Application Window (95/97)
http://support.microsoft.com/?id=258049

ACC2000: How to Disable the Close Button (X) on the Access
Application Window
http://support.microsoft.com/?id=245746

ACC2002: How to Disable the Close Button (X) on the Access
Application Window and the Exit Command on the File Menu
http://support.microsoft.com/?id=300688

Alternatively, take a look here:

http://www.mvps.org/access/general/gen0005.htm

Hope that helps,
Jeff Conrad
Bend, Oregon
 
Allison,

I do exactly what your trying to do as follows:

I have a hidden form with a field on it that I set the
default to 0. The field name os "OkToClose". In that forms
OnClose event I have the following code:

'**********Begin Code********************
Private Sub Form_Unload(Cancel As Integer)

foKtoClose = Me![OkToClose]
Cancel = Not foKtoClose

End Sub
'*************End Code*******************

the variable foKtoClose is a boolean variable declared in
the declarations section of the form.

If you wish to display a message, you could also do that.
What I have simply does not allow them to exit the
application any way except the Quit button I provide on
the Main Menu of the application. I do this so I can do
routine maintenance like cleaning out temp tables and
compacting the database.

Hope this helps!

Kevin
 
Thanks this was exactly what i was after



Jeff Conrad said:
Hi,

From the posts I'm a little unclear if you mean disabling
the form's "X" button or the main Access "X" button. If
you want to disable the main Access "X" button that's
pretty easy to do. I use these techniques. They work great.
Take your pick based on version.

ACC: How to Disable the Close Button (X) on the Access
Application Window (95/97)
http://support.microsoft.com/?id=258049

ACC2000: How to Disable the Close Button (X) on the Access
Application Window
http://support.microsoft.com/?id=245746

ACC2002: How to Disable the Close Button (X) on the Access
Application Window and the Exit Command on the File Menu
http://support.microsoft.com/?id=300688

Alternatively, take a look here:

http://www.mvps.org/access/general/gen0005.htm

Hope that helps,
Jeff Conrad
Bend, Oregon
 
Back
Top