|
-
Sep 21st, 2000, 03:11 PM
#1
Problem with exit prompt
I have a problem with some code that i cant figure out whats is wrong. here it is:
Code:
Private Sub mnuExit_Click()
MsgBox "Do you really want to exit", vbYesNo, "Exit"
If vbYes Then
End
Else
Cancel = 1
End If
End Sub
When you click "Yes" it exits. When you click "no" it exits. what am i doing wrong. (keep in mind that i am a beginner)
-Steve
-
Sep 21st, 2000, 03:24 PM
#2
Fanatic Member
I fixed your code:
Code:
Private Sub mnuExit_Click()
Dim Respons As Long
Respons = MsgBox "Do you really want to exit", vbYesNo, "Exit"
If Respons = vbYes Then
End
Else
Cancel = 1
End If
End Sub
-
Sep 21st, 2000, 03:26 PM
#3
-
Sep 21st, 2000, 03:47 PM
#4
Or use this.
Code:
If MsgBox("Do you want to exit", vbYesNo) = vbYes Then
Unload Me
End If
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|