run-time error 2501

F

Foxtrot

Mdb file is shared by multiple user's.Some of them when trying to run report
geting message:"Run-time error.The OpenReport action was cancelled".
Mdb file was just converted from Access 97 to Acees 2003.
 
W

Wayne Morgan

The error is usually generated by the call that opens the report, such as
DoCmd.OpenReport in the Click event of a button. One common occurrence for
this would be if you had code in the NoData event of the report to close the
report if there is nothing for it to do. The error can usually just be
trapped and ignored in your error handler if everything else is working
properly. However, you may want to step through your code first to make
sure.

The most common problem when going from Access 97 to 2000 or newer is that
2000 or newer uses ADO by default instead of DAO. Both of these object
models of components with the same names, such as Recordset. If your DIM
statements just say "Dim rst As Recordset", Access is probably trying to
create an ADO recordset for you and this may be causing problems with the
results being returned. You'll need to make sure that DAO is checked in the
References. (In the code editor go to Tools|References and make sure there
is a check next to "Microsoft DAO 3.6 Object Library". If there is an
earlier version checked, uncheck it and check the newer one.) Next,
explicitly define with object model to use in your DIM statements by
changing "As Recordset" to "As DAO.Recordset". Do this for all DAO objects
(querydefs, fields, database, etc). Edit|Replace (Ctrl+H) usually works well
for this.
 
P

Patricio Hidalgo

hi Foxtrot

Could you solve it,? I have the same problem. I have an application in the
network and only one user has this problem, he cannot open the reports , the
app display the error 2501 "the openreport was cancelled". Could you give me
more information if you have.

Thanks

Patricio
 
S

Sylvain

I got the exact same problem. One of the user is not able to see the report
from an access shared database and got the 2501 error. What is curious is
that I've been able to see the report twice so it seems to be intermittent.
Is it because the database was not used by anyone else at that time ? The
user has windows XP SP2 and office 2003 (upgrade). I have the same
configuration and it is always working on my computer. I compared the
references and they all are the same. I've been able to execute the query
which fill the report so the connection is good, the problem really comes
from the report.

Is someone has any idea cause I don't know where to search anymore...

Thanks.
 
B

Bushwalker

Duane's solution fixed this problem for me. I changed the default printer
and it now works which is a relief cause I couldn't even open reports in
design view.
thanks Duane.
Grahame
 
E

Eric

Do we have a reason why this happens and a resolution for it? Reason is that
I have this situation and the "default printer" is a OfficeJet Printer but
the printer to which the report needs to be printed is a networked label
printer that has 4x4 labels in it. It works if the Default Printer is set to
the Label Printer, but it doesn't if it is set to the Officejet. I fear that
setting the default printer to the label printer will cause people to print
e-mails, word docs, etc, on a 4x4 label instead of on the Officejet. No
amount of training can compensate for a mistake and 30 wasted labels
 
F

flores

Sylvain,

I get the same error, 2501, only when my interface form is Modal = Yes. If
I make Modal = No, the error no longer occurs. I am trying to keep my input
form Modal, and that's why I still have your same problem. I hope this helps
you. Let me know if how you resolve your problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top