Link to home
Start Free TrialLog in
Avatar of ChuckRush
ChuckRush

asked on

Modal Window Response

Is there a way to act on the response from a model window? I want to fire a subroutine if the repsonse is 'OK' and bypass one it is 'Cancel.
Avatar of AkAlan
AkAlan

The vbYesNo option can be changed, just type and intellisense will give you the options

Dim confirm As VbMsgBoxResult
  confirm = MsgBox("Are you sure you want to do that?", vbYesNo, "Message goes here")
   
        If confirm = 6 Then
         
              'Run Subroutine here        Else
         Else
               'Do something else here
        End If
Avatar of Patrick Matthews
Certainly:



Dim Msg As Long

Msg = MsgBox("Prompt", vbOKCancel, "Title")
If Msg = vbOK Then
    'do something
Else
    'do something else
End If

Open in new window

It's pretty much just one line of code ....

If MsgBox("Prompt", vbOKCancel, "Title") = vbOk Then Call YourFunctionName ()

mx
Avatar of ChuckRush

ASKER

Ty I understandx thaT but I am wanting to act on the response in the window that called the modal window
MX and I show how to do just that.  Where is it that you're getting hung up?
<patrick ... did you end up buying a book?>

mx
Yes, I did.  Will update that later :)
Curious to know which book ... stopping by another B&N later today.
Summit ?
ASKER CERTIFIED SOLUTION
Avatar of Gugro
Gugro

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
Thanks I got to that myself -- sort of had a brain shutdown
ChuckRush
What does that have to do with the MsgBox ?

mx
>>Summit ?

Of course :)