Run Time Error 2501 "The report action was cancel"

G

goraya

hi
I have a access database with some reports. All reports are working
fine except one. When I click Priview or Print window I get the error
"Report Action was canceled" and the error number is 2501. I try to
ignore the error but report does not open. Any help in this regard.
Here is my code.

Private Sub Command15_Click()
On Error GoTo Err_Command15_Click

Dim stDocName As String

stDocName = "Cash Voucher"
DoCmd.OpenReport stDocName, acPreview
ComeHere:
Err_Command15_Click:
If Err.Number = 2501 Then
Resume ComeHere
End If

Any help in this regard ??
Thnx in advance.
 
A

Allen Browne

It will be important to identify why the report is being cancelled.

If the report is bound to a table or query, open that table/query directly
and see if it contains any records. If there are none, the report's No Data
event could be cancelling it.

Similarly, code in the report's Open event could cancel it.

It can also be cancelled by a user pressing Ctr+Break if the report takes a
while to open.

Another reason that it might not open could be a bad printer driver (or no
installed printer.) Since Access uses the metrics of the printer driver to
calculate the layout, this can even affect preview.

If none of these apply, the report itself may be corrupt. Post back if you
need further info on how to address this possibility.
 
G

goraya

It will be important to identify why the report is being cancelled.

If the report is bound to a table or query, open that table/query directly
and see if it contains any records. If there are none, the report's No Data
event could be cancelling it.

Similarly, code in the report's Open event could cancel it.

It can also be cancelled by a user pressing Ctr+Break if the report takes a
while to open.

Another reason that it might not open could be a bad printer driver (or no
installed printer.) Since Access uses the metrics of the printer driver to
calculate the layout, this can even affect preview.

If none of these apply, the report itself may be corrupt. Post back if you
need further info on how to address this possibility.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.










- Show quoted text -

Hi
Thanks for ur reply. Non of above apply to my case except the last
that report it self is corruptted. So how can we address this issue.
Also I donot have a database infact I have a MDE file and I making
changes into it. I donot have access to tables.
 
G

goraya

As you probably realise, you cannot create or fix forms/reports in an MDE.

The simplest solution will be to talk to the person who has the orignal MDB.

If that is not possible, and you have legal rights to it, you may need some
professional help such as this:
http://www.everythingaccess.com/mdeconversion.htm

Hi
I m a little confuse about. The file extension is MDB. I donot know in
which version of access it is build. When I run the application it
show the mean switch board but I donot not have access to the tables.
Is this MDE or it is normal DB and tables are hide some way????
 
A

Allen Browne

So it's probably not an MDE? (The file extension is not the relevant thing
here: it's the content of the file.)

You may be able to get to the Database Container by holding down Shift while
starting the software. Or the developer may have set the AllowBypassKey so
you can't do that.
 
G

goraya

So it's probably not an MDE? (The file extension is not the relevant thing
here: it's the content of the file.)

You may be able to get to the Database Container by holding down Shift while
starting the software. Or the developer may have set the AllowBypassKey so
you can't do that.

Hi
Hurra your last post works. Thank you Dear.
 

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

Similar Threads


Top