Disable Min Max Close on Access Database (not forms)

detrie

Registered User.
Local time
Today, 00:39
Joined
Feb 9, 2006
Messages
113
Hi All,
Is there a way to disable the Access Min Max Close buttons like you can on forms?

I need to have people use a "Close Application" button (there is code behind it)

To be clear.. I need to disable the Min Max Close on the Access application and not forms.

Thanks
Detrie
 
Hi Detrie,

If the first form you open has popup set as "yes" and disable the MIN, MAX etc on that form it might get you what you want,

If that is not what you are looking for then you will need to hide/minimize the Access application itself, use ...

Call fAccessWindow("Minimize", False, False)

Put this into the on load on open event of the first form that is opened.

Garry
 
I don't know how Oldsoftboss' sample file works, but I can tell you that disabling the Access Min, Max and Close buttons, does not force your users to use your custom "Close Application" button.

Among the ones I'm able to remember, theres Ctrl+F4, Ctrl+W (both will close current form) and Alt+F4 (close application) - how are you intending to trap those?

I think the most reliable way of enforcing some code to run when you exit the application, is the one described here http://www.mvps.org/access/general/gen0005.htm

For this to not fire, I think you probably need the "Three-finger-salute" (Ctrl+Alt+Del), power button or other funny stuff. You know, if only one of your users have tried the help file in any of the Office products, the shortcut keys I mentioned above, are very easy to find...
 
Here is an example.

Modal is set to "yes" and the Min, Max, control set to No.

Ctrl+F4, Ctrl+W (both will close current form) and Alt+F4 (close application)

These do absolutely nothing on my PC, so it forces the user to close via the "Exit" Button.

(Ctrl+Alt+Del) will still close the application.

Garry
 

Attachments

Some alternatives
1 - right click form title bar, select Close All (o2k7), or select design view, and then close
2 - hit ctrl+g, then type just quit, application.quit or docmd.close acform, "switchboard"
3 - hit ctrl right arrow, or ctrl+comma, then Ctrl+w or Ctrl+f4 or Alt+F4

I have pesky users, there are even more alternatives. One will hopefully choose a method that is safe enough in the environments one is working.
 
check this out. It dosent disable the min and max but it does disable the Close (X) button
 

Attachments

Yeah, it did work on my a2k, but not on my a2k7 ;)
 
Hi Roy,

If you have users that will go to that extent instead of clicking a large “Exit” button then yes you do need to use the example you posted.

Or

Chop there fingers off :)

I would consider that to be sabotage in which case why not just use the "Three-finger-salute" as you put it.
Fortunately I have never had clients who have had such determination not to use the “Exit" Button provided, however my applications are made into .mde using the “Custom Start up Wizard” and your alternatives do not appear to work.

Do you have any others that I can test?

Garry
 
I Like the example Keith has posted,

Also.....

If Modal is set to "yes" on the first form and the "Shift Bypass" disabled this has the desired effect.
None of the alternative ways of closeing the application has an effect (Access 2003)
Not tested it on 2007

Garry
 
Explain how this works

check this out. It dosent disable the min and max but it does disable the Close (X) button



can you explain how this works or upload the .mdb file so i can look at the code

thanks

Matt Johnson
 
Last edited:
Matt,

You might have missed a step, Keith has posted it as a MDB file.
It works in A2003

Garry
 
Has anyone ever been able to make the MS Access application Close button actually dissappear as well as disabling it?
 
When I need to run Code before the application closes I open a hidden form using AutoExec Macro when my program starts. I place my code in the close event of the hidden form. It will run every time the users closes the app in any fashion.
 
I have a hidden form as you suggested and have the Close button disabled on the main window. I was just wondering whether there was code that would make the Close button disappear in the applications main window. If I want to create a run time version of my database, I don't want the Close button to be visible at all.
 

Users who are viewing this thread

Back
Top Bottom