K
Konchetta via AccessMonster.com
I finally got the message box to pop up but the same time the message box
pops up, the record is deleted without confirmation of yes or no. I know I am
missing something in my code and this forum helped me to get this far from
viewing other posts but not sure what I am missing. Here is my code:
(Deleting a record in a subform)
Private Sub Testdelete_Click()
Dim frm As Form
Dim Response As String
Set frm = Me.[Scheduling Visits Subform].Form
If Not frm.NewRecord Then
With frm.RecordsetClone
.Bookmark = frm.Bookmark
.Delete
Response = MsgBox("Are you sure you want to delete this record")
If Response = vbYes Then
.Bookmark = frm.Bookmark
.Delete
End If
End With
Else
End If
Set frm = Nothing
DoCmd.SetWarnings True
End Sub
pops up, the record is deleted without confirmation of yes or no. I know I am
missing something in my code and this forum helped me to get this far from
viewing other posts but not sure what I am missing. Here is my code:
(Deleting a record in a subform)
Private Sub Testdelete_Click()
Dim frm As Form
Dim Response As String
Set frm = Me.[Scheduling Visits Subform].Form
If Not frm.NewRecord Then
With frm.RecordsetClone
.Bookmark = frm.Bookmark
.Delete
Response = MsgBox("Are you sure you want to delete this record")
If Response = vbYes Then
.Bookmark = frm.Bookmark
.Delete
End If
End With
Else
End If
Set frm = Nothing
DoCmd.SetWarnings True
End Sub