PDA

View Full Version : get rid of the "X"



DBinPhilly
11-01-2010, 02:24 PM
I have a user who likes to click on the "X" in the right corner of each screen to exit a screen, but keeps clicking the "x" at the top of screen, thus closing MS Access.

Is there any way to turn off either or both of those X's to force him to use my screen closing icons?

Imdabaum
11-01-2010, 03:24 PM
Honestly I would be tempted to create a hidden form that loads on statup if his username is detected.

Then on the UnLoad event insert something like,

For i=0 TO 1000
If MsgBox("Do you realize how much money you pay me to bypass " & _
"your responsibility to train yourself?", _
vbQuestion + vbYesNo, "Responsible Much?") <> vbYes
MsgBox "Stop using this 'X' button!", vbExclamation, "Need Tutorial?"
Else
MsgBox "I want a raise for putting up with your lack of dexterity...", _
vbExclamation, "Need Tutorial?"
Next i


But more appropriately to answer your question if your Main Form is always visible, then you may be able to put a checker in the UnLoad event.


Sub UnLoad()
If MsgBox("Do you really want to quit?", vbYesNo, "Exit Application") <> vbYes
Cancel = True
End If
End Sub


From what I understand the Quit command bypasses most other events. But the Unload event will force the quit command to wait.

DBinPhilly
11-01-2010, 03:26 PM
yep, and worse, the guy is the President of the company. How do you tell the boss that he's ugly?

Imdabaum
11-01-2010, 03:31 PM
:rotlaugh:
yep, and worse, the guy is the President of the company. How do you tell the boss that he's ugly?


Well from my philosophy you don't... not unless you are willing to offer him plastic surgery. If you want to point out a problem I feel you should always partner it with a solution. Otherwise you're just contributing to the problem...

As the old saying goes, if you aren't working to solve the problem you are part of it.

DBinPhilly
11-01-2010, 06:22 PM
:rotlaugh:


Well from my philosophy you don't... not unless you are willing to offer him plastic surgery. If you want to point out a problem I feel you should always partner it with a solution. Otherwise you're just contributing to the problem...

As the old saying goes, if you aren't working to solve the problem you are part of it.
or, as Stephen Wright might say, if you're not part of the solution, then you are part of the precipitate.

OBP
11-02-2010, 09:55 AM
DBinPhilly, I have had the code that you need, it disables the X.
I will see if I can find it.

OBP
11-02-2010, 10:31 AM
Can't find the one that I had, but I did find this on the web
http://www.techonthenet.com/access/modules/hide_close.php
and this
http://bytes.com/topic/access/answers/506408-can-i-disable-x-application
and this
http://www.tek-tips.com/viewthread.cfm?qid=1580742