How to Disable the Close Button (X) on the Access Application Window????

I have an Access 2k application that uses the following procedures to disable the Close Button "X" on the Application window.

This works and when I tested it on my workstation (Win XP) the Close Button "X" is disabled and when I Right Click  the application on the Taskbar the "X Close Alt+F4" is also disabled.  

I have a client that's reporting when they Right Click the application on the Taskbar the "X Close Alt+F4" is still active.  They are running Win XP as well (from the screen shot I reviewed) but I will confirm.

Any ideas or input will be appreciated.



LVL 19
Eric ShermanAccountant/DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Leigh PurvisDatabase DeveloperCommented:
Instead of fighting that - you might be as well off to just use the old "Hidden Form - set to Cancel it's Unload event".
Preventing the application from quitting until you say so.
Eric ShermanAccountant/DeveloperAuthor Commented:
Sounds interesting ....

Can you provide some details???
Leigh PurvisDatabase DeveloperCommented:
Umm... hmm... erm...

Create a form frmNoClose.
Create a boolean variable in it's declaration section (this could be done with a texbox control too of course).
Public blnAllowClose as Boolean

It's unload even would look like

Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next

    Cancel = Not blnAllowClose
End Sub

Launch the form hidden
docmd.OpenForm "frmNoClose",windowmode:=acHidden

To allow your application to close call
Forms!frmNoClose.blnAllowClose = True

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Eric ShermanAccountant/DeveloperAuthor Commented:
Thanks LPurvis ...

Since this is a Front-End with a startup form (that has a logout button) I could use the same concept on that startup form.  Just would have to use a text control (hidden) and set it to -1 to force the user to use logout button.  On the Unload Event of this form simply test the value of say TxtForceUser and if -1 Cancel Event.  TxtForceUser is set to -1 on Open and when the user clicks the logout button it is then set to 0.

This seems to work and I don't have to load the extra hidden form.

Thanks for the idea and code.....  I will award you the points.

Leigh PurvisDatabase DeveloperCommented:
No probs ET :-)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.