I have a pop-up that is linked to a table. I have a button on the form to find a record, then I have a button to delete the record. the find works perfectly. The delete button is where I am having problems. The code is:
The error is "The command or action 'DeleteRecord' isn't available now. Any thoughts are to why this is happening?
Code:
Private Sub cmdDeleteTicker_Click()
On Error GoTo Err_cmdDeleteTicker_Click
If MsgBox("Are you sure you want to delete this record?", vbYesNo, "Confirm Delete") = vbYes Then
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True
End If
Exit_cmdDeleteTicker_Click:
Exit Sub
Err_cmdDeleteTicker_Click:
MsgBox Err.Description
Resume Exit_cmdDeleteTicker_Click
End Sub
The error is "The command or action 'DeleteRecord' isn't available now. Any thoughts are to why this is happening?