Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Exit button on VB Form

Posted on 2004-10-22
3
Medium Priority
?
417 Views
Last Modified: 2013-12-26
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.
0
Comment
Question by:jmoneilthe2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 18

Accepted Solution

by:
Sethi earned 200 total points
ID: 12382654
Set Controlbox property of the form to false and BorderStyle to Fixed Dialog. Also ensure that no text is entered in the Caption property.
0
 
LVL 32

Expert Comment

by:Erick37
ID: 12382692
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
0
 

Author Comment

by:jmoneilthe2
ID: 12382714
Excellent. Thank you. This would be better than taking the x out.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question