OpenReport Action Cancelled

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I seem to have fallen into a trap. I designed a database in Access 2003 which
is also accessed by users of Access 2000. I use Event Procedures activated by
clicking a button. All has worked well for a number of weeks, but now I get
the "OpenReport Action Cancelled" on my computer, but no one elses. Tried
e-mailing a copy to my home computer, also with Access 2003 and it worked
perfectly. Problem only seems to be on my works computer???? Please note I am
relatively new to Access and would need soome help - I noted some replies
talking about trapping errors etc. ?????
Thanks

Richard
 
Do you allow the user to choose parameters as they open the report? If so,
what are you doing if there is no data for the parameters they've chosen?
Are you canceling the opening of the report in the reports NoData event?

If you open the report in a button's click event using DoCmd.OpenReport and
you then cancel the report, such as mentioned above or by some other method,
the DoCmd.OpenReport call will return the error you mention. The easiest way
to handle this is to just trap the error and ignore it.

Example:
Private Sub MyButton_Click()
On Error GoTo CheckError
DoCmd.OpenReport "MyReport", acViewPreview
ExitHere:
Exit Sub
CheckError:
'Adjust the Error Number in the next line as needed
If Err.Number = 2501 Then Resume ExitHere
MsgBox "Error Number: " & Err.Number & vbCrLf & Err.Description
Resume ExitHere
End Sub
 
Wayne thanks for your help. I tried your suggestion, but when I tried to open
the report nothing happened i.e. when using a value of = 2501 nothing seemed
to happened, but when I tried values not equal to 2501 I got the error
message "error 2501 openreport action cancelled". Below is the code I use for
the open report action..nothing fancy, no "no dta parameters" etc.

Private Sub All_Jobs_Report_Click()
On Error GoTo Err_All_Jobs_Report_Click

Dim stDocName As String

stDocName = "all jobs by week number report"
DoCmd.OpenReport stDocName, acPreview

Exit_All_Jobs_Report_Click:
Exit Sub

Err_All_Jobs_Report_Click:
MsgBox Err.Description
Resume Exit_All_Jobs_Report_Click

End Sub

Hope you can help

Regards,

Richard
 
On your office/"bad" machine open the problem report in design mode
and doubleclick the Open event. Set a break point (F9) on the first
line of executable code inside the event procedure. Change the report
to run mode and the debugger will halt on your breakpoint. Enable the
debugger/Immediate window and have a ball.

HTH
 
Larry thanks for trying, but I can't open any of the reports in any mode i.e.
design/print preview etc. This is affecting all reports in all databases on
my machine.

Regards,

Richard
 
"Nothing happening" is what I would expect. If you are canceling the opening
of the report, then this will get rid of the error, i.e. nothing happens.
What I would recommend so that this doesn't confuse the user (I'm assuming
here that the NoData event of the report is the problem) is that you place a
message box command in the report's NoData event that informs the user that
there was no data for the current selections.

If something else is causing the canceling, let me know.
 
Wayne, again thanks for replying. This is very confusing. The problem does
not just affect one report, but all reports, in all my databases. I can't
even open them up in design mode. I have not included any 'no data'
parameters. The database I am currently using has been in use my myself and
others for some 2 months. All others are using Access 2000, I am the only
person using 2003.

The code below is for one button on a form which accesses a report, but this
problem is affecting all reports in all my databases. I thought there may be
a problem with the machine and had Access re-installed with no difference.

Any ideas?

Regards,

Richard
 
If you're the only one using 2003, then I would suspect the macro protection
in 2003. As a test, this can be adjusted by going to Tools|Macro|Security.
Setting it to Low (although it will try to discourage you) will be the same
as it is in 2000. Close and reopen the database, does this make a
difference?

Have you tried copying a working copy of the file from another computer?
Does the problem still occur once the file is opened on your computer? Do
you get any other error messages?
 
Tried lowering the security level already..made no difference.

The database sits on a central server (I believe this runs Windows NT) and
accessed by all of us, so copying it would not make any difference, although
I did e-mail it to my home computer, also running 2003, and it works ok there.

I do not get any other messages. I strongly suspect the problem is some
setting on my computer at work, but have no idea what. A DVD reader was
recently installed (while I was on holiday) and it may be coincedence,but it
is since then that the problem has occurred.

Regards,

Richard
 
If you're accessing it over a network, each user should have their own copy
of the forms, reports, queries, etc in a front-end file and that file should
have linked tables in it to a back-end file on the server. The back-end file
should only have the tables and table relationships. Also, if you use
temporary tables for anything, they should be in the front-end or, better
yet, in a temp mdb created in the %temp% directory then deleted when you're
done with it.

Since you say it worked ok when you copied it home, it still makes me
curious if it will work ok if you copy it to your computer where it doesn't
work. If it works ok when you copy it to your computer, then the problem is
with the network settings between your computer and the server or with the
setup as mentioned in the first paragraph. If it still doesn't work, then
it's probably something on your computer, but we need to isolate where the
problem is.
 
Wayne, thanks for all your help, but our company I.T. "expert" seems to have
solved the problem. According to him it was a corrupt user account.

Again, many thanks for your advice.

Regards,

Richard
 
This is an extremely common problem, and it's caused by the Access reporting
subsystem not always recognising your default printer if it's network
connected. If you change your default printer to a local printer, I would
guess that it will work. I have so far seen no acknowledgement from any MS
sources that this is an Access issue - they just suggest updating your
printer drivers to the latest version.

Hope this sorts you out.

Jon.
 
I just encoutered the same exact problem with not being able to run any
reports or access (no pun intended) the reports in Design view or any other
way. Jon, you're a genius. I cannot thank you enough for your tip. My
problems began occurring just after I had installed a printer at one of our
remote locations to use when I visited this remote site. Even though the
printer was on our company network, once it was made the default printer all
my problems began. All I had to do was change the default printer back to
the previous default printer (located in our corporate office) and everything
was back to normal. Jon, thanks again!
 
Richard,
we have seen this occur four times in the last several months (since
upgrading to Office 2003). I belive it is a problem with this version. We had
to use the sam "fix" of rebuilding the user profile at a considerable
inconvenience. I personally have had it happen to me twice. I am one of the
Acess designers at our company and use it daily so this is a big problem in
my mind. I am surprised that it is not reported more often based on the
frequency of occurance for us. I was hoping to find a solution that did not
require rebuilding of profiles or a "fix" from Microsoft but have not found
any yet.


Tracy
 
Hi Tracy

Have you been able to find a solution to this problem? I am having this
problem. I emailed it to our Access program designer and it doesn't happen on
his machine. Nor does it happen to anyone else in office. I am only one
running 2003. However I have been using it since Sept and yesterday was
first day with problem. Maybe something to do with automatic update? But if
so, how do I roll back an update? I did not create restore point before
updates were done but maybe I should be.

Thanks
Lori
 
Hi Kayle:

I had the same problem of not able to open the reports in design view as
well. In additon it gave me the "OpenReport Action Cancelled" error. This
problem already got me stuck for two days.

As always each version of Access has its own bugs. I supposed this is
another Access bug in Access 2003.

Guess what, I had this peculiar problem resolved by tring out one of the
suggestions given from the Internet. By the way, some of the solutions given
might give you a Wild Goose Chase but then they were in good intention trying
to help us.

No one in the world would think of that it has something to do with your
default printer. All you have to do is delete your existing default printer
and add back in the deleted printer and set it as your default printer.

This worked but who knows why. I will let the Access experts figure this one
out.

Good Luch and hope this help you.
Eddie.
 
I'm having the same error message, but from another point of view:

At my company, we have flexible work places where you can log in to your own
computer account. On our corridor, we have 7 computers. On six of them, my
database - opened from the company's network - works fine for me and my
colleagues. But on the seventh, it gives the error 2501 (OpenReport Action
Cancelled) when the button "Print Preview" is pressed, and furthermore it
gives the error 3011 on the button "Print Report". These errors on this
particular computer do not only appear on my account, but also when my
colleagues try to do these actions.

To test if it was an error in MY database, I've made a new database and
tried to make a new report, but Access refused to make that report. Therefore
I assume that the problem is somewhere inside the computer, and not in my own
work.

I don't want the user to think that I made a crappy database when the error
is actually a problem of the user's computer. So the least I could do is
inform the user in a message box why he/she has a problem and what he/she
could do next. Now I have two questions, and I hope one of you readers can
answer at least the first one...!


1. What is actually WRONG here?

2. How can this problem be solved?
 
I maintain a substantion Db at the office here, and two days ago we received
a new network printer. Two days of a specific user being able to print
reports and open reports, and now BAM! "Openreport Action was cancelled".

I knew about the printer glitch...but what does one do when deleting the
printer and reinstalling it doesn't work?

HELP???
 
I think I may be able to help with this problem. I maintain various
access databases at my firm and some users get exactly this problem
from time to time. Eventually I discovered that it is a printer
setting for their default printer that is causing the problem and by
changing that, the reports will load ok.

If you select file-print-properties-advanced for the printer in
question and find the setting for Graphics Mode it will show either
'Send Graphics as Vector' or 'Send Graphics as Raster' (or at least it
does on my system). I have found that by changing that setting from
one to the other solves the problem.

I have no idea why this happens and can only guess that it is the same
problem that you are getting but it may be worth having a look.

Simon
 
Hi,

Thanks for the detail below it has solved a similar problem for me as well
as for a colleague. I recently changed laptops, both my old and new machines
run XP and Office 2003. Running montly reports on my old laptop was fine but
it wouldn't work on my new one despite the username, printer settings etc
being identical.
Following what you said below I tried the file/print etc but the print
element of the file menu was not accessible. I changed the default printer
from a HP to a Canon on my new laptop and the reports now perfectly well.

There must be logical explaination but it's beyond me!

Cheers Richard W.
 
Back
Top