Hello,
I am trying to add a delete button to a form to delete the current record but it always says the command deleterecord isnt available now.
Any ideas? My code is as follows-
I am trying to add a delete button to a form to delete the current record but it always says the command deleterecord isnt available now.
Any ideas? My code is as follows-
Code:
Private Sub command11_Click()
Dim Answer As Integer
Answer = MsgBox("Are you sure you wish to delete this Purchase Order?", vbYesNo + vbExclamation + vbDefaultButton2, "Delete Confirmation")
If Answer = vbYes Then
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True
End If
End Sub