Mark
1/23/2003 5:54:00 PM
Shawn,
I'd recommend simplifying some of your code a bit to make it a bit easier to
read and debug ...
dim vbResponse
vbResponse = MsgBox("Are you sure you want to delete the record?", vbYesNo
+ vbCritical, "My Title")
if (vbResponse = vbYes) Then
' Perform some action.
msgbox ("Delete me")
Else
' Perform some other action.
msgbox ("Delete aborted")
End If
Hope that helps.
Mark
www.dovetaildatabases.com
"Shawn" <x_zz@yahoo.com> wrote in message
news:#biNntvwCHA.2504@TK2MSFTNGP10...
> I have a VBScript for the popup message box as following
>
> <SCRIPT LANGUAGE="VBScript">
> <!-- Instruct non-IE browsers to skip over VBScript modules.
> 'Option Explicit
> Sub cmdDelete_OnClick
> If MsgBox("Are you sure you want to delete the record?", _
> MsgBoxStyle.DefaultButton2 Or MsgBoxStyle.Critical Or
> MsgBoxStyle.YesNo, _
> "Confirm Deletion") = MsgBoxResult.Yes Then ' User chose Yes.
> ' Perform some action.
> Else
> ' Perform some other action.
> End If
> End Sub
> -->
> </SCRIPT>
>
> It doesn't work well. When I click the cmdDelete button, it show me the
> followin error:
> Error: Object required: 'MsgBoxStyle'
>
> I am new in VBScript. Is there any one who can help me fix it? I assume
the
> default focus is No button in the message box.
>
> Thanks.
>
>
>
>
>