We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

Report does not open.

OliviaRedhorse
on
Medium Priority
442 Views
Last Modified: 2012-05-06
When I opened the Access file, I could not open the Report in Design View nor through the VBA code I created.  Last time, I worked on this file, it worked fine.  When I use the button to open a Report through VBA code, I get a 'Runtime error 2501', OpenReport action canceled.  How do I fix this?  Thanks
Comment
Watch Question

CERTIFIED EXPERT
Commented:
That error usually results from a VBA error. You are going to have to follow the code carefully, until you locate it.


Kelvin

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Commented:
Try making a Tools-Database Utilities-Compact and Repair Database to see if it's some bug, or the database is damaged.

jppinto
Commented:
Also check the query that you use as your report Record Source to see if it's working or it can be this that is causing the error.

jppinto
Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007
Commented:
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 = True ... 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 in this example ... you have to trap that error around the OpenReport command.

So ... maybe this example will help you track it down?
************************************
Private Sub cmdPrintApp_Click()
    On Error GoTo Err_cmdPrintApp_Click
    DoCmd.OpenReport "SomeReportName", acPreview

Exit_cmdPrintApp_Click:
    Exit Sub
Err_cmdPrintApp_Click:
    If Err.Number = 2501 then   ' You cancelled .....
         ' no action required
    Else
         MsgBox Err.Description
    End If
    Err.Clear
    Goto Exit_cmdPrintApp_Click
End Sub

Related Q's:

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Access_Coding-Macros/Q_23753771.html

mx

Author

Commented:
The button that contains the VBA code; creates a make-table, displays the make-table and then displays the report.  In my situation, it works all the way to the when the report needs to be displayed.  So, the make-table is displayed and then I get the error. Would it make any difference that I am using a make-table?

Author

Commented:
jppinto,
I did try to repair the database as you suggested I still received the same error.  I cannot open the report in design view or any view for that matter.

I think it has to do my report source because I cannot view any of my reports in any view.  I am going to try to recreate it.

Author

Commented:
There is something definitely wrong.  I cannot open any of my reports in any access file.  Nor can I open them in design or view a report I just created.  HELP.  Thank you!  

One thing I though was funny was, I have Office 2003 and when I create a new access file, the header says in '(Access 2000 file format)', shouldn't it say '(Access 2002-2003 file format)'?
Commented:
Try creating a new blank database and copy your object to that new database to see if you can open your reports.

jppinto

Author

Commented:
jppinto,

I did try that but it did not work.  Here is did.  I opened a new access file and imported needed tables, created a simple query and tried to create a report using the Design view, but it did not open.  I then tried using the wizard, and at the end, I received 'The wizard is unable to create your report.' message.  I am not sure if this makes a difference, but the tables I am importing are Access 2002-2003 format and although, my current Office is 2003, I see (Access 2000 file format).  None of my other Access db are displaying reports, but they did before.

Author

Commented:
Could it be my printer?  Our network printer has been out of service lately and I had to change my default printer.  How do I update the printer location in Access or how can I resolve this problem?  I appreciate it, thanks.

Author

Commented:
Yes, it was the printer.  It works now.
Commented:
You should had mentioned that you had changed the printer!! This way, we could direct our attention to that and not waste time thinking it was an Access problem.

I'm glad that you fix the problem.

jppinto
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.