Docmd.outputto Runtime Error 2501
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
Runtime Error 2501 Access
2 1 2 > Thread Tools Rating: Display Modes 09-30-2011, 06:06 AM #1 justin198z28 Newly Registered User
The Outputto Action Was Cancelled Access 2007
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
The Outputto Action Was Cancelled Pdf
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 run time error 2501 access computers 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 Publ
for 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 run time error 2501 the runmacro action was canceled Project Hire for a Full Time Job Ways to Get Help Expand run time error 2501 the save action was canceled Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines access runtime error 2501 outputto action was cancelled Experts Exchange > 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 http://www.access-programmers.co.uk/forums/showthread.php?t=216260 2008-03-27 MS Access 3 Verified Solutions 10 Comments 2,630 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: "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 https://www.experts-exchange.com/questions/23276218/Error-when-outputting-report-The-OutputTo-action-was-canceled.html 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 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)
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 http://www.dbforums.com/showthread.php?1215163-Run-time-Error-2501 viewing messages, select the forum that you want to visit from the selection below. Results 1 to 7 of 7 Thread: Run-time Error '2501' Tweet Thread Tools Show Printable Version Subscribe to http://www.pcreview.co.uk/threads/the-outputto-action-was-cancelled-runtime-error-2501.2450937/ this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 04-06-06,18:55 #1 nckdryr View Profile View Forum Posts Computer Monkey Join Date May 2005 Posts error 2501 1,191 Unanswered: Run-time Error '2501' Hey guys, I've been having troubles with access. The database is stored on the network drive and is accessed by multiple users. One user has been having troubles just recently in using a search form I created on the database (his screenshot with the error is attached). Over the last month, when he tries to use the search form, he will time error 2501 occasionly get this error message. When you click the Search button, the form is supposed to pull up a report that is based on a query that has its criteria from the form (hope that makes sense). But he (and as far as I know, only he) has been having this problem. Does anyone know what may be causing this? Has anyone seen this problem before? And, more importantly, does anyone know how to fix it? Thanks in advance to anyone who can help. Attached Thumbnails Me.Geek = True Reply With Quote 04-06-06,21:30 #2 tcace View Profile View Forum Posts Registered User Join Date Apr 2004 Location outside the rim Posts 1,011 As indicated in your screenshot, the OpenReport action was canceled. Run Time error 2501 most often occurs when something is Canceled. For example, if a report is sent to the printer using the OutputReport action and the user hits cancel while it is spooling, it will return error 2501, which you can trap. Also, if the OpenForm method is called and something causes the form to cancel opening (either Cancel was set to True during open, or an unhandled error occurs, trigger
Guest I'm using the OutputTo method to export the results of a query to Excel, and it is working fine so long as the user does not cancel the action when the filename dialog box displays, at which point an error occurs. This is what I wrote to ouput the results to Excel: DoCmd.OutputTo acOutputReport, Me.Export2ExcelList, acFormatXLS, , True My question is: how can i stop the runtime error? Guest, Mar 19, 2006 #1 Advertisements tina Guest you need to include error handling code in the procedure, such as On Error GoTo Handle_Err DoCmd.OutputTo acOutputReport, _ Me.Export2ExcelList, acFormatXLS, , True Exit_Err: Exit Sub Handle_Err: Select Case Err.Number Case 2501 ' The OutputTo action was cancelled. Resume Exit_Err Case Else Msgbox Err.Number & " " & Err.Description Resume Exit_Err End Select hth "StuJol" <> wrote in message news:... > I'm using the OutputTo method to export the results of a query to Excel, and > it is working fine so long as the user does not cancel the action when the > filename dialog box displays, at which point an error occurs. > > This is what I wrote to ouput the results to Excel: > DoCmd.OutputTo acOutputReport, Me.Export2ExcelList, acFormatXLS, , True > > My question is: how can i stop the runtime error? > tina, Mar 20, 2006 #2 Advertisements Show Ignored Content Want to reply to this thread or ask your own question? It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum. Sign Up Now! Similar Threads DoCmd.SendObject/OutputTo and Error 10 - This array is fixed or temporarily locked Ran Ronen, Jul 1, 2003, in forum: Microsoft Access External Data Replies: 0 Views: 1,169 Ran Ronen Jul 1, 2003 Specifying the file name from a form when using Outputto method Jason, Aug 29, 2003, in forum: Microsoft Access External Data Replies: 2 Views: 615 Jason Sep 10, 2003 Overflow error with docmd.outputto Victor, Sep 30, 2003, in forum: Microsoft Access External Data Replies: 0 Views: 391