View Full Version : Disable Min Max Close on Access Database (not forms)
detrie 01-03-2008, 01:52 PM 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
Zigzag 01-03-2008, 02:02 PM 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
Oldsoftboss 01-03-2008, 09:32 PM Try this....
RoyVidar 01-04-2008, 12:07 AM 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...
Zigzag 01-04-2008, 08:38 AM 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
RoyVidar 01-04-2008, 08:58 AM 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.
KeithG 01-04-2008, 09:33 AM check this out. It dosent disable the min and max but it does disable the Close (X) button
RoyVidar 01-04-2008, 09:48 AM Yeah, it did work on my a2k, but not on my a2k7 ;)
Zigzag 01-04-2008, 09:57 AM 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
Zigzag 01-04-2008, 12:16 PM 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
mattyj1990 01-05-2008, 10:13 AM 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
Mike375 01-05-2008, 10:23 AM check this out. It dosent disable the min and max but it does disable the Close (X) button
I opened that and got stuck in Access:)
I made a macro/Quit:D
Zigzag 01-05-2008, 03:02 PM Matt,
You might have missed a step, Keith has posted it as a MDB file.
It works in A2003
Garry
|
|