Outputto Pdf Error 2501 The Outputto Action Was Cancelled
Contents |
Posters Today's Posts Search Community Links Social Groups Pictures & Albums Members List Calendar Search Forums Show Threads Show Posts Tag Search Advanced Search Find All Thanked Posts the outputto action was cancelled access 2010 pdf Go to Page... Page 1 of 2 1 2 > Thread
The Outputto Action Was Cancelled Access 2007
Tools Rating: Display Modes 09-30-2011, 06:06 AM #1 justin198z28 Newly Registered User Join Date: Sep 2011 Posts: 4
The Outputto Action Was Cancelled Pdf
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 vb macro in access 2007 that returns a "runtime
Runtime Error 2501 Openform Action Was Canceled
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 and uninstalling/reinstalling printer drivers. I've added error handling to ignore error 2501 but run-time error '2501' the openreport action was canceled 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 Profile Find More Posts by justin198z28 09-30-2011, 06:22 AM #2 gemma-the-husky Super Moderator Join Date: Sep 2006 Location: UK Posts: 13,144 Thanks
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 access error 2501 Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs docmd.outputto acoutputreport Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just ms access output to pdf 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 http://www.access-programmers.co.uk/forums/showthread.php?t=216260 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 http://stackoverflow.com/questions/20060388/access-error-2501-the-outputto-action-was-canceled-running-from-system-account 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 OutputTo PDF? pdf ms-access-2010 share|improve this question asked Nov 18 '13 at 23:48 GSaintD 2113 Do you have any PDF 'printer' installed (e.g. an Adobe trial) other than the default provided by Office? –Cal279 Jan 13 '14 at 9:30 I know that this won't help you with your current problem, but, for the long term, I advise you to move to a different architecture. Running Office applications in an unattended (e.g. service) context is officially not supported by Microsoft. –Hein
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask https://www.experts-exchange.com/questions/28050409/run-time-errors-DoCmd-OutputTo-acOutputReport.html 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 http://www.dbforums.com/showthread.php?1695619-OutPut-to-Command-Error-2051 Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > run-time errors: DoCmd.OutputTo action was acOutputReport Want to Advertise Here? Solved run-time errors: DoCmd.OutputTo acOutputReport Posted on 2013-03-02 MS Access 3 Verified Solutions 14 Comments 2,044 Views Last Modified: 2013-03-19 I’m running OutputTo vba code for a dozen reports similar to that as shown: Dim ExportDir As String Dim NewRef NewRef = Format(Now(), the outputto action "mmddyy") ExportDir = "S:\Finance\Finance Shared\Cash Management\Receipts Allocations\Reports\" DoCmd.OutputTo acOutputReport, "rpt_Batches_Incomplete_Detail", acFormatPDF, ExportDir & NewRef & "_Incomplete_Batches_Detail.pdf", False, "" The function runs for eleven outputs before I get either 1) "run-time error 2544 microsoft cannot find the rpt_Batches_Incomplete_Detail you referenced in the object name argument" or 2) "run-time error '2501' the outputto action was canceled." This could just be an invalid character in the file name but I’ve tried changing it to a single “B.” I'm using DAO 3.6 reference library and the database works except the one line so I'm not up for changing that. I've tried some preceeding code but other outputto's work without it: "DoCmd.SelectObject acReport, "rpt_Batches_Incomplete_Detail", True" Frankly, I don't even know what it does since I don't use it for all outputs. Any ideas what is wrong with JUST this 'DoCmd.OutputTo acOutputReport' line? 0 Question by:CFMI Facebook Twitter LinkedIn Google LVL 48 Active today
visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 12 of 12 Thread: OutPut to Command Error 2051 Tweet Thread Tools Show Printable Version Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 08-16-13,06:26 #1 Vickles View Profile View Forum Posts Registered User Join Date Nov 2012 Posts 20 Unanswered: OutPut to Command Error 2051 Hi, Please can someone help me figure out why I am getting Error 2051 "Outputto action was cancelled" My coding is as follows: Private Sub Command77_Click() If Me.FolderName = "January" Then Dir ("\\DISKSTATION\Innovative Physics\Admin\Invoices, Quotes, Credit Notes and Purchase Orders\Invoices Sent\2013\January\" & "Job#" & Space(3) & Me.Job_Number & Space(3) & Me.Job_Description & "\" & "Outgoing") End If Dim MyFileName As String Dim MyPath As String MyPath = "\\DISKSTATION\Innovative Physics\Admin\Invoices, Quotes, Credit Notes and Purchase Orders\Invoices Sent\2013\January\" MyFileName = "IPL" & Space(1) & Me.Company_Code & Space(1) & "13" & Space(2) & Me.Sales_Invoice & ".pdf" DoCmd.OutputTo acOutputReport, "rptSalesInvoice", acFormatPDF, MyPath & MyFileName, False End Sub I have looked through many threads and have been able to solve this issue. Reply With Quote 08-16-13,10:01 #2 Burrina View Profile View Forum Posts Registered User Join Date Nov 2011 Posts 413 If Err.Number = 2051 Then End If Reply With Quote 08-16-13,10:08 #3 Vickles View Profile View Forum Posts Registered User Join Date Nov 2012 Posts 20 Thank you for the quick reply. I have tried that...still get the error message. Reply With Quote 08-16-13,10:27 #4 Burrina View Profile View Forum Posts Registered User Join Date Nov 2011 Posts 413 Try adding this to the bottom of your code: Error_Handler: Select Case Err.Number Case 2501 Err.Clear Resume Error_Handler_Exit Case Else MsgBox "Error No. " & Err.Number & vbCrLf & "Description: " & Err.Description, vbExclamation, "Database Error" Err.Clear Resume Error_Handler_Exit End Select Reply With Quote 08-16-13,10:44 #5 Vickles View Profile View Forum Posts Registered User Join Date Nov 2012 Posts 20 Thank you for your help. I get the error message label not defined on Resume Error_Handler_Exit Reply With Quote 08-16-13,11:58 #6 Burrina View Profile View Fo