Ms Access Error 2501 Outputto
Contents |
Posters Today's Posts Search Community Links Social Groups Pictures & Albums Members List Calendar Search Forums Show Threads Show runtime error 2501 openform action was canceled Posts Tag Search Advanced Search Find All Thanked Posts Go to the outputto action was cancelled access 2007 Page... Page 1 of 2 1 2 > Thread Tools Rating: Display Modes 09-30-2011, 06:06
The Outputto Action Was Cancelled Pdf
AM #1 justin198z28 Newly Registered User Join Date: Sep 2011 Posts: 4 Thanks: 2 Thanked 1 Time in 1 Post runtime error 2501 outputto action was cancelled
Run Time Error 2501 Access
with access vb macro Hi! I'm struggling with a 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 run time error 2501 the save action was canceled 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 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
be down. Please try the request again. Your cache administrator is webmaster. Generated Thu, 20 Oct 2016 17:14:17 GMT by s_nt6 (squid/3.5.20)
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 http://www.dbforums.com/showthread.php?1215163-Run-time-Error-2501 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 this Thread… Search Thread Advanced Search Display Linear http://www.pcreview.co.uk/threads/the-outputto-action-was-cancelled-runtime-error-2501.2450937/ 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 1,191 Unanswered: Run-time Error '2501' Hey guys, I've been having troubles error 2501 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 occasionly get this error message. When you click the Search button, the form is supposed to time error 2501 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, triggering Cancel = True) then error 2501 is triggered. There are other ways to get 2501, almost all of them involve canceling an operation. I suggest you place an error trap in the procedure
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,171 Ran Ronen Jul 1, 2003 Specifying the file name from a form when using Outputto method Jaso