Hi All.
I have form with command button to delete record. All work fine except after I receive my confirm to delete a record I'm goting MS Access confirm like:
"You are about to delete 1 row(s) from the specified table. One you click Yes, you can't the Undo command to reverse the changes".
How to avoid that confirm and keep only my? Code which I use look like:
I have form with command button to delete record. All work fine except after I receive my confirm to delete a record I'm goting MS Access confirm like:
"You are about to delete 1 row(s) from the specified table. One you click Yes, you can't the Undo command to reverse the changes".
How to avoid that confirm and keep only my? Code which I use look like:
Code:
Private Sub cmdDelete_Click()
Dim Sql As String
If MsgBox("Do you wish to delete this record?", vbYesNo, "Delete Confirmation") = vbYes Then
If MsgBox("Are you SURE you want to delete this record?" & vbCrLf & _
"This will permanently delete the record.", vbYesNo, "2nd Delete Confirmation") = vbYes Then
Sql = "DELETE FROM Inventory WHERE InventoryID = " + lstRequest.Column(0)
DeleteListItem Me.lstRequest, Sql
End If
End If
DoCmd.RunSQL Sql
End Sub