I have a question about running a Delete query in VBA code in Access 2016.
below is my code:
Private Sub cmdDelete_Click()
On Error GoTo Err_cmdDelete_Click
Dim Msg as String
Dim Response as Integer
Msg = "You are about to delete the following action from the table: " & vbCrLf & vbCrLf
Msg = Msg & vbTab & Prod#: " & vbTab & Form_frmProduct.ProdNum & vbCrLf
Msg = Msg & vbTab & "Entered on : " & Form_frmProduct.EnterDate & vbCrLf
Msg = Msg & vbTab & "Entered by : " & Form_frmProduct.EnterUser & vbCrLf
Msg = Msg & vbCrLf & " Do you want to delete this record>"
Response = MsgBox(Msg, vbYesNo + vbApplicationModal + vbQuestion + vbDefaultButton2, "Delete confirmation")
If Response = vbYes then
docmd.close acForm, "frmProduct"
What I want to do is once the "Delete confirmation" screen pop up, users click Yes then every will be done and close the form instead showing "You're about the run a delete query that will modify data in your table" then users have to click "Yes" then another pop up screen "You are about to delete 1 row(s) from the specified table" then users have to click "Yes" again to delete the record. Any suggestion will be very appreciated!