Microsoft Visual Basic Runtime Error 2501
Contents |
Posters Today's Posts Search Community Links Social Groups Pictures & Albums Members List Calendar Search Forums Show Threads run-time error '2501' the outputto action was canceled Show Posts Tag Search Advanced Search Find All Thanked Posts Go runtime error 2501 openform action was canceled to Page... Page 1 of 2 1 2 > Thread Tools Rating: Display Modes 09-30-2011, 06:06 run time error 2501 access 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 the outputto action was cancelled access 2007 cancelled 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
Run Time Error 2501 The Save Action Was Canceled
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 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", , , , acExportQua
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
Run Time Error 2501 The Runmacro Action Was Canceled
the selection below. Results 1 to 7 of 7 Thread: Run-time Error '2501' Tweet Thread the outputto action was cancelled pdf Tools Show Printable Version Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded access 2010 error 2501 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 with access. The database is stored on the network drive and is http://www.access-programmers.co.uk/forums/showthread.php?t=216260 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 pull up a report that is based on a query that has its criteria from the form (hope http://www.dbforums.com/showthread.php?1215163-Run-time-Error-2501 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 that opens the report. If Err.Number = 2501, then the user hits cancel. If the Err.number is anything else, post a messagebox with Err.Number and Err.Description have fun! Todd S. click to email Independent Developme
FORUMSFOR COMPUTER PROFESSIONALS Log In Come Join Us! Are you aComputer / IT professional?Join Tek-Tips Forums! Talk With Other http://www.tek-tips.com/viewthread.cfm?qid=1453633 Members Be Notified Of ResponsesTo Your Posts Keyword Search One-Click Access To YourFavorite Forums Automated SignaturesOn Your Posts Best Of All, It's Free! Join Us! *Tek-Tips's functionality http://visualbasic.ittoolbox.com/groups/technical-functional/vb-access-l/vba-runtime-error-2501-the-outputto-action-was-cancelled-3812722 depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting Guidelines Promoting, selling, recruiting, coursework and thesis posting is forbidden.Tek-Tips Posting Policies error 2501 Jobs Jobs from Indeed What: Where: jobs by Link To This Forum! Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.Just copy and paste the BBCode HTML Markdown MediaWiki reStructuredText code below into your site. Microsoft: Access Forms Forum at Tek-Tips HomeForumsProgrammersDBMS PackagesMicrosoft: Access Forms Forum Runtime Error 2501 time error 2501 on Cmd.Save thread702-1453633 Forum Search FAQs Links MVPs Runtime Error 2501 on Cmd.Save Runtime Error 2501 on Cmd.Save sheusz (TechnicalUser) (OP) 25 Feb 08 19:56 Hi All,I have a database that is run across a server that used to work fine. Recently I added the following code to one on the data entry forms;CODEPrivate Sub Form_BeforeUpdate(Cancel As Integer)'Provide the user with the option to save/undo'changes made to the record in the formIf MsgBox("Changes have been made to this record." _& vbCrLf & vbCrLf & "Do you want to save these changes?" _, vbYesNo, "Changes Made...") = vbYes ThenDoCmd.SaveElseDoCmd.RunCommand acCmdUndoEnd IfEnd SubThe form work fine if there is only one user accessing the database, but as soon another user uses the database, then tries to to save a record on the form I get the following error;Run-Time error '2501'The Save action was canceled.Checking the Debug Screen highlights the lineDoCmd.SaveIf I remove the above code everything works fine.We are using MS Access 2
Technology and Trends Enterprise Architecture and EAI ERP Hardware IT Management and Strategy Java Knowledge Management Linux Networking Oracle PeopleSoft Project and Portfolio Management SAP SCM Security Siebel Storage UNIX Visual Basic Web Design and Development Windows < Back CHOOSE A DISCUSSION GROUP Research Directory TOPICS Database Hardware Networking SAP Security Web Design MEMBERS Paul_Pedant DACREE MarkDeVries MacProTX VoIP_News Inside-ERP Inside-CRM I_am_the_dragon maxwellarnold Michael Meyers-Jouan TerryCurran Chris_Day Andrew.S.Baker Ramnath.Awate JoeTorre Locutus Craig Borysowich Dennis Stevenson mircea_luca Richard DukeGanote iudithm Clinton Jones bracke Nikki Klein AbhaiTripathi Iqbalyk jakarman Adrian_Grigoriu knowscognosdoi COMPANIES SendGrid ZOHO Corporation Apperian eFax Corporate View All Topics View All Members View All Companies Toolbox for IT Topics Visual Basic Groups Ask a New Question Visual Basic for Access For discussion on Visual Basic for Access , please visit the Visual Basic – General Discussions group. More Visual Basic Groups Your account is ready. You're now being signed in. Solve problems - It's Free Create your account in seconds E-mail address is taken If this is your account,sign in here Email address Username Between 5 and 30 characters. No spaces please The Profile Name is already in use Password Notify me of new activity in this group: Real Time Daily Never Keep me informed of the latest: White Papers Newsletter Jobs By clicking "Join Now", you agree to Toolbox for Technology terms of use, and have read and understand our privacy policy. VBA run-time error 2501 - the OutputTo action was cancelled Azhar Mujib asked Oct 13, 2010 | Replies (1) I have designed a software in Microsoft Access 2007, which generates a series of 6-10 reports depending upon option selected. These reports are converted to PDF format b