|
-
June 5th, 2000, 08:24 AM
#1
msgBox
I use a msgBox vbYesNo before i close the form.
What can i do to do the difference between if the user press yes or no?
-
June 5th, 2000, 08:28 AM
#2
Re: msgBox
If MsgBox("Ask A Question", vbYesNo + vbQuestion) = vbYes then
'Code for Yes
else
'Code for No
End If
-
June 5th, 2000, 08:28 AM
#3
Re: msgBox
use the following
Dim Reply as string
Reply = msgbox("Are you sure?", vbyesno)
If Reply = vbyes then
End 'exit program
End If
Hope this helps
Rob
-
June 5th, 2000, 01:00 PM
#4
Re: msgBox
You have to use a variable dedicated to the msgBox if you want to react.You should use the values.6 is standard for "Yes" and 7 is standard for "no".With this piece of code your programm should work (pleas put it in one line):
If msgBox("[enter your message here]", vb_yesno, "[Title]") = 6 then ... [if he chose "yes"] else ... [if he chose "no"]
for example:
If msgBox("Do you want to quit?", vb_yesno, "Quit?") = 6 then unload me
In this case the programm ends if he chooses "yes"
If he choses "no", nothing will happen!
I hope this helps you! Bye, Nanobert
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
|