Scott:

This code works, but may not be optimal!

    sResult = InputBox("Are you ready to Proceed with batch creation
process?", _
        "All Information has been gathered", "Yes I am ", 2000, 2000)
    If "" = sResult Then
        MsgBox ("Cancelled")
    ElseIf "Yes I am " = sResult Then
        MsgBox ("OK")
    Else
        MsgBox ("Unexpected result")
    End If

The user could edit the text, throwing your logic off.  I'd use

    valResult = MsgBox("Ready to go?", vbOKCancel, "All Information has been
gathered")
    
    If vbOK = valResult Then
        MsgBox ("OK")
    ElseIf valResult = valResult Then
        MsgBox ("Cancelled")
    Else
        MsgBox ("Unexpected result")
    End If

instead.

Hope this helps!

Ernest Adams
Lawrence & Memorial Hospital
New London, CT

-----Original Message-----
From: White, Scott A [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 01, 2004 2:53 PM
To: [EMAIL PROTECTED]
Subject: [Talk] Input Box - Cancel


Hi,
Does anyone know the "secret" to activating the Cancel button on an input
box here in BWS?

This is what I was attempting.... notice that I said attempting here.

RUReady = InputBox("Are you ready to Proceed with batch creation process?",
"All Information has been gathered", "Yes I am ", 2000, 2000)

'*** This block is to allow the user to cancel running of the script***
If Click = vbCancel Then
Wait 1
Shutdown = True
Wait 1
Else
If Click = vbOK Then
Wait 1
End If
'*** end of the cancel program block ***

Thank you,
Scott


****************************************************************************
***********
CONFIDENTIALITY NOTICE: This e-mail communication and any 
attachmentsmay contain confidential and privileged information for the 
use of the designated recipients named above.  If you are not the intended
recipient, you are hereby notified that you have received this communication
in error and that any review, disclosure, dissemination, distribution or 
copying of it or its contents is prohibited.
If you have received this communication in error, please notify Saratoga 
Hospital immediately by e-mail at [EMAIL PROTECTED] and destroy
all copies of this communication and any attachments.

Reply via email to