J
joelb
I am looking for a way to change the default on this Msgbox from OK to
Cancel when confirming the deletion. Any help would be appreciated....
My code is listed below.
Joel
Private Sub cmdDelete_Click()
On Error GoTo ErrorHandler
Dim strSQL As String
If MsgBox("Are You Sure?", vbOKCancel) = vbOK Then
'Deletes the Item from the PublicationItems table
strSQL = "EXEC spDeletePublicationItemUi @PublicationItemId = " &
fnReplaceSQL(Me.PublicationItemId.Value)
DoCmd.RunSQL (strSQL)
'Refresh Publication Items
Me.Requery
Else
End If
Exit Sub
ErrorHandler:
fnErrorHandler Me.Form.Name, _
vbCrLf _
& "Recordsource: " & Me.Form.RecordSource & vbCrLf _
& "Input Parameters: " & Me.Form.InputParameters & vbCrLf _
& "Active Control: " & Me.ActiveControl.Properties("Name")
End Sub
Cancel when confirming the deletion. Any help would be appreciated....
My code is listed below.
Joel
Private Sub cmdDelete_Click()
On Error GoTo ErrorHandler
Dim strSQL As String
If MsgBox("Are You Sure?", vbOKCancel) = vbOK Then
'Deletes the Item from the PublicationItems table
strSQL = "EXEC spDeletePublicationItemUi @PublicationItemId = " &
fnReplaceSQL(Me.PublicationItemId.Value)
DoCmd.RunSQL (strSQL)
'Refresh Publication Items
Me.Requery
Else
End If
Exit Sub
ErrorHandler:
fnErrorHandler Me.Form.Name, _
vbCrLf _
& "Recordsource: " & Me.Form.RecordSource & vbCrLf _
& "Input Parameters: " & Me.Form.InputParameters & vbCrLf _
& "Active Control: " & Me.ActiveControl.Properties("Name")
End Sub