Can anyone give me an example of code that would use this entire command?
Printable View
Can anyone give me an example of code that would use this entire command?
I'm not sure what your asking but vbyesnocancel is used with the msgbox function. It gives you a meesage box that contains a yes, no and cancel button.
msgbox "message",vbyesnocancel,"Title"
I know about the msg part, the part I need to know about is how it works, does it use an IF THEN ELSE statement, or what? Please show an example.
This is what I have...
Private Sub savefile()
MsgBox "Do you want to Submit another Problem", vbYesNo
If vbYes Then
clearfields
Else
MsgBox "We have been notified. Thank You."
Unload Me
End If
End Sub
This doesn't work...if I click no, it does the same thing as VBYES. What is wrong with this?
Here I will tell you again but thats ok
dim happy as string
Private Sub savefile()
happy = MsgBox ("Do you want to Submit another Problem", vbYesNo)
If happy = vbYes Then
clearfields
Else
MsgBox "We have been notified. Thank You."
Unload Me
End If
End Sub
Sorry forgot () last time
------------------
Sincerely,
Chris
:-) ;-)
Email [email protected]Quote:
just have fun out there and live life to the fullest while it is still here
[This message has been edited by PITBULLCJR (edited 02-02-2000).]
thanks again...
Here:
Good luck.Code:Reply = MsgBox("Yes will continue, No will stop, and cancel will do nothing", 3, "Yes, No, and Cancel prompt")
If Reply = 6 Then 'they hit Yes
MsgBox "You hit Yes"
ElseIf Reply = 7 Then 'they hit no
MsgBox "You hit No"
Else
MsgBox "You hit cancel"
End If
------------------
DiGiTaIErRoR
VB, QBasic, Iptscrae, HTML
Quote: There are no stupid questions, just stupid people.
the VbYesNo and others are simply consts for integer type
while asking a message box (msgbox) to draw the VbYesNo or what ever command button you wish for, you simply check:
result=msgbox("are you sure",VbYesNo)
if result=VbYes then
'do something
end if
Here is another one for you :)
Hope this helps ;)Code:Dim Response As Integer
Response = MsgBox("Do you want to exit?", vbYesNoCancel + vbQuestion, "Exit?")
Select Case Response
Case vbYes
MsgBox "You pressed Yes"
Case vbNo
MsgBox "You pressed No"
Case vbCancel
MsgBox "You pressed Cancel"
End Select
------------------
david
Teenage Programmer