Catching VbMsgBoxResult

  • Thread starter Thread starter jose luis
  • Start date Start date
J

jose luis

Hi All,

How could i catch the result of a MsgBox and derive actions from th
user decision? Any help welcome!.

Thanks in advance

jose luis

P.D. Here is what i though will do the trick. I was wrong.


GuardarAntes()
MsgBox "Save Changes?", vbYesNoCancel, "Save?"

If VbMsgBoxResult.vbYes = 6 Then
MsgBox "Yes"
End If
If VbMsgBoxResult.vbNo = 7 Then
MsgBox "No"
End If
End Su
 
Public Sub catchResponse()
Dim iResponse As Integer

iResponse = MsgBox("Please Respond", vbYesNo, "My Response")

MsgBox "My Resonse Is: " & iResponse, vbInformation, "Resonse"

End Sub
 
Jose
Try this

Sub doit()
Dim Response
Response = MsgBox("Save Changes", vbYesNoCancel, "Save")
If Response = vbYes Then
MsgBox "Yes"
Else
MsgBox "no"
End If
End Sub

Neil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top