Delete Event not behaving consistently (1 Viewer)

Local time
Today, 00:51
Joined
Feb 25, 2008
Messages
410
I have this code on a form that is usually displayed through a subform control of another form.

Code:
Private Sub Form_Delete(Cancel As Integer)
    If MsgBox("Are you sure you want to delete this note?", vbYesNo, "Confirm Delete") = vbNo Then
        Cancel = True
    End If
End Sub

When the form is being displayed through a subform control:
If a user deletes a record, they are asked to confirm. If the user clicks No, that should be the end of the story, but for some reason, the user is asked a second time.

When the form is being displayed on it's own, the code works correctly and the user is asked only once to confirm the deletion.

Why is this happening?
 
Local time
Today, 00:51
Joined
Feb 25, 2008
Messages
410
I figured out how to fix it, but I still don't understand why it acted like that.

I had to change the form's AllowEdits property to Yes.
 

Users who are viewing this thread

Top Bottom