Delete Record - The RunCommand action was canceled.

TJBernard

Registered User.
Local time
Today, 04:52
Joined
Mar 28, 2002
Messages
176
This is a new one, I have not experienced this problem before.

I have an MS Access 2003 DB that is linked to a SQL 2000 back-end (to store the tables).

On my form I have a "Delete" button to delete records. The code is simple and has worked in the past for me...

Code:
    Dim I As Integer
    
    I = MsgBox("Are you sure you want to delete this record?", vbYesNo, "Delete Record")
    
    If I = 6 Then
        DoCmd.RunCommand acCmdDeleteRecord
    End If

When I try to delete a record, I get the error...

Code:
Run-time error '2501':

The RunCommand action was canceled.

I have tried add in the DoCmd.RunCommand acCmdSelectRecord before the Delete Record command line, and I go the same error.

I also tried using a Recordset.Clone statement to delete the record, and I got the same error.

I have searched Google and this forum, and I have tried all the solutions (many repeated the advice above) and nothing appears to work.

I was wondering if anyone had run into this error, and if so, if there is a fix.

Thank you,

T.J.
 
have you looked up the error in the Help log file? Would the deletion cause an orphan record? Why do you have an integer variable assigned to a message box that displays only two text options?
 
have you looked up the error in the Help log file? Would the deletion cause an orphan record? Why do you have an integer variable assigned to a message box that displays only two text options?

I have found the fix. I had to refresh a link on the SQL side between two tables.
 

Users who are viewing this thread

Back
Top Bottom