Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to disable the close button??? 1

Status
Not open for further replies.

jinglin

MIS
May 4, 2004
72
US
When my users are using the Access application, some of them might exit the application by clicking on the Close button on the top right. How can I disable this button and let the users exit the application gracefully?

Thanks for your help

 
go into the properties and loook for close button and make it no

Hope this helps
Hymn
 
The way I like to perform this, is described in mstrmage1768's faq faq702-1870.

Roy-Vidar
 
I think you're talking about the main window's close box, not a form's.

My method is somewhat like the FAQ RoyVidar mentioned. I open a hidden, empty form when the application starts up. This form has a Close event that calls my graceful shutdown code.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
RoyVidar
I like mstrmage1768's faq FAQ702-1870. that is simple but appears very effective, nice one

Hope this helps
Hymn
 
Rick was right. I'm talking about the main window's close box, not the one on the form. I want to remove the 'x' for the application itself in the upper right corner. How can I make API calls to do it???

Thanks, all

Jinglin
 
Thanx - yeah the simplicity and efficiency of it is something I really like!

Removing the x is mainly a visual thingie, and will not disable for instance ALT+F4, CTRL+F4, CTRL+W and other means of closing the app/last form on the app, which you'll probably also need to do. thread702-831433 has one suggestion and a link to a Microsoft solution.

Roy-Vidar
 
Here's an alternative which effectively disables the close box, as well as Alt+F4, Ctrl+F4, etc. It even prevents shutting down Windows or using the Task Manager to kill Access.

When the application starts, open a hidden, empty form which has the following in its Unload event procedure:
Code:
    Cancel = True
    MsgBox "Please use the 'Exit' button to end the application"

This avoids the messy API calls.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top