message box (vbYesNo) not working

nooner

Registered User.
Local time
Today, 20:59
Joined
Feb 27, 2003
Messages
11
I have an option button used to quit the application, after it is pressed a msgbox (vbYesNo) appears asking the user "are they sure they want to exit", when they select yes they exit the applcation, the problem is that when they select No, they also exit the application!.How do I correct this.Thanx in advance for any suggestions you can give.
 
Code:
    If MsgBox("Are you sure you want to quit?", vbQuestion + vbYesNo, "Exit") = vbYes Then
        DoCmd.RunCommand acCmdExit
    Else
        'what else is there to do?
    End If
HTH
 
If they select No Iwant the operation of them quiting the application to be cancelled and for the user to return to the main form.

ElseIf GrpOptionGroup = 4 Then
MsgBox "Are you sure you want to exit the Project Management Portal", vbYesNo, "Business Systems Planning"
If vbYes Then
DoCmd.Quit = True
'ElseIf vbNo Then
'DoCmd.Quit = False
'End If

Thank You for your help.
 
I can already get it to quit the application, the problem is that i do not want to quit the application if I select No. At the moment when I press Yes or No it is quitting, thanks for your response.

ElseIf GrpOptionGroup = 4 Then
MsgBox "Are you sure you want to exit the Project Management Portal", vbYesNo, "Business Systems Planning"
If vbYes Then
DoCmd.Quit
 
If MsgBox("Are you sure you want to exit the Project Management Portal", vbYesNo, "Business Systems Planning") = vbYes Then
DoCmd.Quit
End if
 
Dim Msg, Style, Title, MyString, Response
If GrpOptionGroup = 4 Then
MsgBox "Are you sure you want to exit the Project Management Portal"
Style = vbYesNo + vbExclamation + vbDefaultButton1
Title = ""Business Systems Planning""
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
DoCmd.Quit
End if
 

Users who are viewing this thread

Back
Top Bottom