Access Run Time Error 2501 Outputto Action Was Canceled
Contents |
Posters Today's Posts Search Community Links Social Groups Pictures & Albums Members List Calendar Search Forums Show Threads Show Posts Tag Search Advanced runtime error 2501 openform action was canceled Search Find All Thanked Posts Go to Page... Page 1 of 2 the outputto action was cancelled access 2007 1 2 > Thread Tools Rating: Display Modes 09-30-2011, 06:06 AM #1 justin198z28 Newly Registered User
The Outputto Action Was Cancelled Pdf
Join Date: Sep 2011 Posts: 4 Thanks: 2 Thanked 1 Time in 1 Post runtime error 2501 outputto action was cancelled with access vb macro Hi! I'm struggling with a
Run Time Error 2501 The Runmacro Action Was Canceled
vb macro in access 2007 that returns a "runtime error 2501 outputto action was cancelled". The codes is intended to break up a 1690 page report into 338 five page pdfs, name them, and save in a file structure it creates. Unfortunately it errors when it finishes creating the first pdf - the debugger highlights the DoCmd.OutputTo acOutputReport line. I've tried different computers runtime error 2501 outputto pdf and uninstalling/reinstalling printer drivers. I've added error handling to ignore error 2501 but the code then runs but the pdfs and folder structure is never produced. This code worked the last time the report was run a year ago. I've inherited this project from someone who left the company and I have to admit I have almost no knowledge of vb code. Any idea what the problem is? Option Compare Database Option Explicit Private Sub CreateReports_Click() Dim cn As ADODB.Connection Dim rsDistricts As ADODB.Recordset Set cn = CurrentProject.Connection Set rsDistricts = cn.Execute("SELECT [District_Code], [AGENCY_KEY], [AGENCY_NAME] FROM District_List") Do Until rsDistricts.EOF 'Open report for a specific district DoCmd.OpenReport "JUSTIN_District_Report_Template for 2010-11 9-27", acViewPreview, , "[District_Code]='" & _ rsDistricts![District_Code] & "'", acWindowNormal 'Output report to pdf file DoCmd.OutputTo acOutputReport, "JUSTIN_District_Report_Template for 2010-11 9-27", acFormatPDF, _ "G:\OEA\TSH\ACCESS for ELLs Data\SecureReports\AMAO Reports\" & rsDistricts![AGENCY_KEY] & "\999999\2010_11\" & rsDistricts![AGENCY_NAME] & "_" & rsDistricts![District_Code] & "_ELL_AMAO_2010-11.pdf", , , , acExportQualityPrint 'Close report DoCmd.Close acReport, "JUSTIN_District_Report_Template for 2010-11 9-27" rsDistricts.MoveNext Loop cn.Close End Sub The Following User Says Thank You to justin198z28 For This Useful Post: godknow(04-25-2013) justin198z28 View Public Pro
be down. Please try the request again. Your cache administrator is webmaster. Generated Fri, 30 Sep 2016 01:14:01 GMT by s_hv987 (squid/3.5.20)
Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today https://www.experts-exchange.com/questions/23276218/Error-when-outputting-report-The-OutputTo-action-was-canceled.html Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > http://stackoverflow.com/questions/20060388/access-error-2501-the-outputto-action-was-canceled-running-from-system-account Questions > Error when outputting report: The OutputTo action was canceled. Want to Advertise Here? Solved Error when outputting report: The OutputTo action was canceled. Posted on 2008-03-27 MS Access 3 Verified Solutions 10 Comments 2,606 Views Last Modified: 2013-11-27 Hello.. All of the sudden, seemingly out of the blue, I can get an error every time I try to Output a report: action was "Run-time error 2501: The OutputTo action was canceled." The code that generates the error is: DoCmd.OutputTo acOutputReport, Me.Name, acFormatPDF, strInvPath I have tried the following steps to troubleshoot: 1. Go back to previous versions of the DB where the Output worked... still generated the error 2. Change the format to acFormatRTF... still generated the error 3. Change the Path (strInvPath) to "c:\" .. still generated the error 4. Try the code with a different report .. still generated the time error 2501 error I'm at a loss, I can't for the life of me figure out where this error is coming from. It really puzzles me that it worked before in previous versions, now I go back to those previous versons, and it's not working. Any help would be great... thanks! -cdmac 0 Question by:cdmac2 Facebook Twitter LinkedIn Google LVL 75 Active today Best Solution byDatabaseMX (Joe Anderson - Access MVP) 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 ... Go to Solution 10 Comments LVL 75 Overall: Level 75 MS Access 75 Message Active today Accepted Solution by:DatabaseMX (Joe Anderson - Access MVP)2008-03-27 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 .
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Access Error 2501: The OutputTo action was canceled. Running from System Account up vote 4 down vote favorite 1 I'm having trouble with Microsoft Access 2010. I have a reporting module that prints reports to printer, or to file. The reports can be user requested, or automatic print. The user requested reports run from the desktop logged in user. The automatic print is kicked off by my Windows Service. We used to print these to .RTF and they work fine. We want to modify our access reporting database to print to .PDF. This is where the fun begins. If we launch the access database as a user application, the report prints fine. If we launch the access database from our windows service we get an error 2501 "The OutputTo action was canceled." This application is running on Windows 2008 Server R2. DoCmd.OpenReport "Summary", acViewPreview DoCmd.OutputTo acOutputReport, "Summary", acFormatPDF, DataBasePath & "Summary.pdf" DoCmd.Close acReport, "Summary", acSaveNo If I change the acFormatPDF to acFormatRTF (and change the filename to summary.rtf) this works fine. If I run this code as a logged in user, it works fine and generates the PDF. If I change my windows service to "run as" a user instead of the System Account, it works as well. Unfortunately, I'm not in a position to run the service as a user account (without a LOT of testing). Any thoughts on why the system account cannot Output