Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WHY?: RunCommand giving run-time error

Status
Not open for further replies.

whatisahandle

Programmer
Jul 26, 2001
18
CA
Hi,

I have a form in which the delete button calls the following line of code:

DoCmd.RunCommand acCmdDeleteRecord

this is to delete the current record.

The problem is I get an Access built-in messagebox which asks me to confirm the deletion. If I answer no, I get this run time error:

Run-time error '2501':
The RunCommand action was cancelled

I can I avoid this problem ?

Thanks,

Chris
 

Option 1
On Error Resume Next

Option 2
On Error GoTo HandleErr

' Code ...

Exit_Proc:
Exit Sub

HandleErr
If Err.Number = 2501 Then
Resume Exit_Proc
End If
Exit Sub

Steve King Growth follows a healthy professional curiosity
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top