Link to home
Start Free TrialLog in
Avatar of John Carney
John CarneyFlag for United States of America

asked on

Code that allows for 3 actions on a YesNoCancel MsgBox without redisplaying the alert

I'm feeling kind of brain dead on this one.

    If MsgBox("Are you sure you want to process one incident only?", vbYesNoCancel) = vbCancel Then
    Exit Sub
    Else
    If MsgBox("Are you sure you want to process one incident only?", vbYesNoCancel) = vbNo Then
    GoTohere
    Else
    If MsgBox("Are you sure you want to process one incident only?", vbYesNoCancel) = vbYes Then
    GoTothere
    Else
    End If
    End If
    End If

Open in new window

This obviously re-displays the alert two more times unless you choose vbCancel.

So how do I write it?

Thanks,
John
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of John Carney

ASKER

Awesome, thanks MartinLiss. Just one little typo in line 3. I need to add the parentheses
intResponse = MsgBox ("Are you sure you want to process one incident only?", vbYesNoCancel)

Thanks,
John
Yes, I typed that directly into the post and forgot the parentheses. In any case you're welcome and I'm glad I was able to help.

Marty - MVP 2009 to 2012