Access 2007 acOutputReport

Posted on 2010-01-11
Medium Priority
Last Modified: 2013-11-28
I have the following code:

DoCmd.OutputTo acOutputReport, "rptBreakdown10Snapshot", acFormatSNP, ReportFinal

It worked  in 2003 but now I can't get it to work in 2007. I keep getting the following error. I have tried downloading the snapshot view and adding it to my reference library in Access 2007 and it still will not work.

Run-Time error '2501':
The OutputTo action was canceled.


Question by:LeLeBrown
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4

Author Comment

ID: 26289260
I did some testing and if I remove the DoCmd.OutputTo acOutputReport, "rptBreakdown10Snapshot"  from the statement and select snapshot viewer and then type the file name in, it works. I can also leave the statement like this: DoCmd.OutputTo acOutputReport, "rptBreakdown10Snapshot", ,ReportFinal (Report Final being the file name) and it will work. It doesn't seem to like the acFormatSNP.


Author Comment

ID: 26289273
Ignore last post. I meant to say if I remove the acFormatSNP from the DoCmd statement it works. I just have to select Snapshot from a menu that pops up. I have over 3500 reports though so this will not work for me.


Author Comment

ID: 26289376
Once again. Ignore my last post... the problem seems to be with the ReportFinal variable that holds the file name.
This Does NOT work:
DoCmd.OutputTo acOutputReport, "rptBreakdown10Snapshot", acFormatSNP, ReportFinal
This DOES work - but I have to name each individual file:
DoCmd.OutputTo acOutputReport, "rptBreakdown10Snapshot", acFormatSNP

This worked fine in 2003 or maybe it was because it was on a different machine. Do you have to set certain reference libraries in order to have it save?


Accepted Solution

LeLeBrown earned 0 total points
ID: 26289988
Nevermind.... I found the problem.
LVL 31

Expert Comment

by:Helen Feddema
ID: 26294160
Just a thought -- if you are running Access 2007, it is generally a good idea to output to PDFs rather than snapshots, because PDFs are more widely useful.  Here is some code for outputting a report to a PDF file:

DoCmd.OutputTo acOutputReport, "rptInvoice", _
      acFormatPDF, "Invoice.pdf", True

Open in new window


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

777 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