Results 1 to 2 of 2
  1. #1
    charly.csh is offline Competent Performer
    Windows 11 Office 365
    Join Date
    Nov 2014
    Posts
    186

    Event Close and

    Hello everyone,

    Today I have a question that maybe is really easy to solve but I am stucked. I made a form and on the event for close the form I added a Message Box "Yes" or "No"


    What I want to do is if the user say "Yes" the form will close otherwise choosing "No", the form will stand "open", my question is on the second option since it's actually closing anyway

    Thanks for helping!!!!

    Code:
    On Error GoTo Err_MainMenu_Click
    
    Dim MessageBox As Integer
    MessageBox = MsgBox("żDo you want to get-out?", vbQuestion + vbYesNo, "Management Tool")
    
    If MessageBox = vbYes Then
    
    MsgBox "Thanks for using Management Tool, See you!", vbInformation, "Management Tool"
    Application.Quit
    
    ElseIf MessageBox = vbNo Then
    
    'HERE I DON'T KNOW WHAT TO ADD TO KEEP IT OPEN WITH NO CHANGES
    
    End If
    
    Exit_MainMenu_Click:
    '    Exit Sub
    
    Err_MainMenu_Click:
    ' MsgBox "Error, contact your IT manager", vbExclamation, "Management Tool"
    
    End Sub

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 15
    Last Post: 04-20-2022, 03:27 AM
  2. Replies: 1
    Last Post: 11-28-2017, 07:28 AM
  3. Bypassing the On Close Event in a Report
    By Oxygen Potassium in forum Access
    Replies: 5
    Last Post: 06-06-2017, 11:52 AM
  4. Replies: 3
    Last Post: 09-28-2016, 07:36 AM
  5. Replies: 2
    Last Post: 07-05-2015, 09:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums