Access 2003 - run-time error 2501

We are getting an error message when trying to run one of our access files.  The error message reads: "Run-time error 2501 - The OpenReport action was canceled"  -- when I click on debug it brings me to the following line of code:
            DoCmd.OpenReport stDocName, acViewPreview

This report runs fine when we remote into work from home.  I am not familiar with visual basic code so any help would be appreciated before I have to call out the person that wrote this code.  What is confusing is it runs fine when accessed from the girl's computer from home.  I have uninstalled and re-installed Office2003 Pro and applied SP2.  
Any help is appreciated.  Thank you.
mmj1Asked:
Who is Participating?
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Here is a typical example where that error occurs, which may help you track it down:

You have button which opens a report ..
   DoCmd.OpenReport "YourReport"

But ... the report has No Data ... and in the OnOpen event of the report, you have a message box that pops up and says "Sorry, no Data"  if the NoData property = Truen ... and then you Cancel the opening of the report. Back at the Open command ... you will the get the message ""You cancelled the previous operaton".

So ... you have to trap that error around the OpenReport command.

So ... maybe this example will help you track it down?

mx
0
 
mmj1Author Commented:
Thank you for your help.  It ended up being an issue with the installation of Windows and/or Office.  I re-installed Windows and Office on one of the computers and the database runs fine.  Thank you for your help.  
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
you are welcome.

mx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.