Interesting! CloseCommand isn't built into Access. I think you probably
got it from this Knowlegebase article:
http://support.microsoft.com/kb/245746
ACC2000: How to Disable the Close Button (X)
on the Access Application Window
For any lurkers: the article shows how to create a class module named
CloseCommand that uses Windows API calls to disable the "X" button on the
Access application window. I just tried it out and it works.
It does not disable the File -> Exit menu item, so it won't preven the
user from closing Access that way. If one's goal is to prevent the user
from exiting the application without running some special termination
code, this won't do it. But it seems to me like a handy way to prevent
inadvertently clicking on the application's X button when, for example,
forms are opened in a maximized state. I've run into that problem from
time to time, so I'm glad to ler of this technique.
Thanks, Ken!
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)