error catching for 2501 (1 Viewer)

Rx_

Nothing In Moderation
Local time
Today, 05:49
Joined
Oct 22, 2009
Messages
2,803
For other encountering Error 2501 (err.number 2501) - a little more informatoin.

http://www.access-programmers.co.uk/forums/showthread.php?t=73805&highlight=error+2501
Maybe worth a note if the code is from the 2003 era. See page 2
http://www.access-programmers.co.uk/forums/showthread.php?t=216260&highlight=2501
This also seemed to happen when a user added a slash in the file name.

Also wanted to remind: Code written in Access 2007 running on Access 2010 with out going through an Import All Object:
This is one of the error tht did appear our of nowhere in the past.
Perhaps the Access SP have fixed that by now? Who knows?
http://www.access-programmers.co.uk/forums/showthread.php?t=232352&highlight=2501
Opening an Access 2010 blank database and Importing All Objects from Access 2007 fixed this error with no code changes. I don't know why, and I really don't care. The point is, that the proper way to open an older Access 2007 using Access 2010 is to go through the process and Import all objects into Access 2010.

Maybe this can help others save some time to solve this pesky little error.
 

nickblitz

Registered User.
Local time
Today, 19:49
Joined
Oct 29, 2012
Messages
30
Code:
On Error GoTo Foutje

DoCmd.OpenReport "Sum Reasons", acPreview, , strFilter
DoCmd.SendObject acReport, stDocName

Exit Sub

Foutje:
If Err.Number = 2501 Then
     MsgBox "Cancelled"
Else
     MsgBox Err.Description
End If
End Sub
 

Users who are viewing this thread

Top Bottom