Exit button on VB Form

Is there a way to remove the exit button on a form? I want to force my users to use my exit button because I log them in and out of the application and I don't want them to find a way out of it by using the x button to exit.
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.

Set Controlbox property of the form to false and BorderStyle to Fixed Dialog. Also ensure that no text is entered in the Caption property.

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
You can logoff users in the QueryUnload event...

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    If (UnloadMode = vbFormControlMenu) Or (UnloadMode = vbFormCode) Then
        'Catch both unloading from code (menu) and from [X] button
        Debug.Print "Logoff users here"
    End If
End Sub
jmoneilthe2Author Commented:
Excellent. Thank you. This would be better than taking the x out.
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
Visual Basic Classic

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.