?
Solved

Report does not open.

Posted on 2009-02-13
12
Medium Priority
?
429 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
0
Comment
Question by:OliviaRedhorse
12 Comments
 
LVL 22

Assisted Solution

by:Kelvin Sparks
Kelvin Sparks earned 240 total points
ID: 23637435
That error usually results from a VBA error. You are going to have to follow the code carefully, until you locate it.


Kelvin
0
 
LVL 33

Assisted Solution

by:jppinto
jppinto earned 960 total points
ID: 23637446
Try making a Tools-Database Utilities-Compact and Repair Database to see if it's some bug, or the database is damaged.

jppinto
0
 
LVL 33

Assisted Solution

by:jppinto
jppinto earned 960 total points
ID: 23637487
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
0
Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 800 total points
ID: 23637519
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
0
 

Author Comment

by:OliviaRedhorse
ID: 23637591
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?
0
 

Author Comment

by:OliviaRedhorse
ID: 23659720
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.
0
 

Author Comment

by:OliviaRedhorse
ID: 23660042
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)'?
0
 
LVL 33

Assisted Solution

by:jppinto
jppinto earned 960 total points
ID: 23660100
Try creating a new blank database and copy your object to that new database to see if you can open your reports.

jppinto
0
 

Author Comment

by:OliviaRedhorse
ID: 23660300
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.
0
 

Author Comment

by:OliviaRedhorse
ID: 23660363
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.
0
 

Author Comment

by:OliviaRedhorse
ID: 23661198
Yes, it was the printer.  It works now.
0
 
LVL 33

Assisted Solution

by:jppinto
jppinto earned 960 total points
ID: 23662373
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
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question