A
Andy
Hi;
Code is suppose to Cancel the Delete. It doesn't.
The first half does stop the Record from being deleted,
The second half, after ELSE, brings up the standard warning box informing:
"Relationships that specify cascading deletes are about to cause 1 record(s)
in this table and in related tables to be deleted.
Are you sure you want to delete these records."
Juse want the delete event to cancel.
Would someone be so kind and tell me what is missing?
Thank You.
Andy
Private Sub Form_Delete(Cancel As Integer)
If Me![chkbxDeleteBlockedYN] = True Then
Cancel = True
MSGBOX "This Record is Protected and can't be deleted."
Else
MSGBOX "Do You really want to delete this Record from the Database?",
vbOKCancel
Select Case Msg
Case vbYes
Cancel = False
Case vbCancel
Cancel = True
End Select
End If
End Sub
Code is suppose to Cancel the Delete. It doesn't.
The first half does stop the Record from being deleted,
The second half, after ELSE, brings up the standard warning box informing:
"Relationships that specify cascading deletes are about to cause 1 record(s)
in this table and in related tables to be deleted.
Are you sure you want to delete these records."
Juse want the delete event to cancel.
Would someone be so kind and tell me what is missing?
Thank You.
Andy
Private Sub Form_Delete(Cancel As Integer)
If Me![chkbxDeleteBlockedYN] = True Then
Cancel = True
MSGBOX "This Record is Protected and can't be deleted."
Else
MSGBOX "Do You really want to delete this Record from the Database?",
vbOKCancel
Select Case Msg
Case vbYes
Cancel = False
Case vbCancel
Cancel = True
End Select
End If
End Sub