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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to Disable Close Button 5

Status
Not open for further replies.

gmillerinc

IS-IT--Management
Aug 27, 2003
28
US
I would like to disable the CLOSE ("x") button on a form. I have attempted to do this by going into the Form's properties and choolse Close Button = No in the format tab.

When the form is not fully maximized this works fine. But when it is maximized, the Close Button is active.

Any way to make it disable even when maximized?

I'm working with Access 97
 
Thank you.

Life's a journey enjoy the ride...

jazzz
 
a STAR to Jazz. I just got this blessed code working in an Access97 database and will be putting it in the AccessXP versions in the very near future. [bigglasses]

I elaborated on BobJacksonNCI's code a tad: [tt]

Private Sub Form_Unload(Cancel As Integer)
Cancel = Not OK2Close
If OK2Close = False Then MsgBox _
"As said in the directions and in countless emails, do NOT click on the X to close, but rather use the Big EXIT button", vbCritical, "HA - Got you trying to cheat"
End Sub [/tt]

Well thats the prototype code, I may do some refining...
 
For those who don't want to teast the user with the message box to tell her/him to click the appropriate button to exit, you can replace the msgbox code with codes below to click the Exit button for the user. here is the code I used to replace the message box.

DoCmd.OpenForm "StartForm"
Me!cmdExitButton.SetFocus
SendKeys "{enter}"

The users will most likely apprepriate you are not controlling their behaviors!


 
HomeAlone,

That IS a good idea!

Hmmm, if the form that is controlling this has been minimized, can it just be specified and SendKeys executed or does it have to be activated first...

Never mind, I'll do a little legwork on my own.

Thanks I believe it's Star-worthy!
Bob
 

My concern for throwing up the intercept dialog box (besides venting) is to educate the users that the buttons are disabled, rather than them clicking on it 50 times before calling me or IT.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top