Microsoft Access Error Code 2501
Contents |
Search Community Links Social Groups Pictures & Albums Members List Calendar Search Forums Show Threads Show Posts Tag Search Advanced Search Find All Thanked Posts Go to Page... Page 1 of 2 1 2 > Thread ms access error 2501 the openform action was cancelled Tools Rating: Display Modes 02-05-2007, 02:33 PM #1 ShanVel ShanMug Join Date:
Access Run Time Error 2501 Outputto Action Was Canceled
Oct 2005 Location: Akron, OH, USA Posts: 51 Thanks: 0 Thanked 0 Times in 0 Posts Run-time error 2501; OpenReport action was cancelled error 2501 access Folks, Need your help. I searched the entire forum and found couple of postings on this, but none of them indicates if there is any fix for this problem. If there is no data, basically I access 2010 error 2501 want to show a message and close the report. I have some code to handle this under no data event like below: Private Sub Report_NoData(Cancel As Integer) MsgBox "There is no data for this report. Canceling report..." Cancel = True End Sub But this 2501 always pops up and I couldn't find a way to stop this. I also searched Microsoft knowledgebase, no help. Here's how my clik event procedure looks like: Private Sub
Run Time Error 2501 The Runmacro Action Was Canceled
cmdSearch_Click() On Error GoTo Err_PreviewRprt Dim strTbl As String Dim strSQL As String Dim strOptItem As String Dim strOptBlrType As String Dim strMsg As String, strTitle As String Dim intStyle As Integer 'Set up SQL statement for report record source If IsNull(optCriteria) Then optCriteria = 1 strTbl = Me.cboTypeOfGuar.Column(0) strOptItem = Choose(optCriteria, "memPred", "memGuar", "memRiskLevel", "memLDs") strOptBlrType = Choose(optBoilerType, "SWUP", "RB", "CFB", "All") strSQL = "SELECT tblProjts1.chrProjectName, tblProjts1.chrBlrPropNum, tblProjts1.chrBoilerType, " & _ strTbl & ".memGuranItem, " & strTbl & "." & strOptItem & _ " FROM tblProjts1 INNER JOIN " & strTbl & " ON " & _ "tblProjts1.intProjectId = " & strTbl & ".intProjectId" & _ " WHERE (((" & strTbl & ".memGuranItem)" & " IS NOT NULL)" & " AND " & "((tblProjts1.chrBoilerType) = '" & strOptBlrType & "'))" 'Open report in Design view to set the report's record source 'and search item label's caption DoCmd.Echo False 'suppress the screen updates DoCmd.OpenReport "rptBlrSrchItem1", acViewDesign With Reports("rptBlrSrchItem1") .RecordSource = strSQL .Controls("strOptItem").ControlSource = Choose(optCriteria, "memPred", "memGuar", "memRiskLevel", "memLDs") End With DoCmd.Close , , acSaveYes 'Now show the search results to the user DoCmd.OpenReport "rptBlrSrchItem1", acViewPreview DoCmd.Echo True Exit_PreviewRprt: Exit Sub Err_PreviewRprt: If Err = 2501 Then Resume Exit_PreviewRprt Else MsgBox Err.Description Resume Exit_PreviewRprt End If End Sub Any help is much appreciated. ShanVel View Public Profile Find More Posts
be down. Please try the request again. Your cache administrator is webmaster. Generated Thu, 20 Oct 2016 13:24:16 GMT by s_wx1085 (squid/3.5.20)
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 https://www.experts-exchange.com/questions/27908573/Run-time-error-2501-in-Access.html 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 200
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 Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > Run-time error 2501 in Access Want to Advertise Here? Solved Run-time error 2501 in Access Posted on 2012-10-21 MS Access Programming MS Applications 1 Verified Solution 9 Comments 3,425 Views Last Modified: 2012-10-21 All of a sudden our Access 2003 "application" isn't working. We have this database complete with forms, multiple tables, queries, etc. When I attempt to open a form, via a button, I get: Microsoft Visual Basic Run-time error 2501 The OpenForm action was canceled. Clicking the debug button brings me to it's click event... highlighting the following line: DoCmd.OpenForm "frmInputNew" So... I go to the frmInputNew form and look in the Open event to see: Dim test As Variant 'set focus on Lot Inventory Me.OrderBy = "" Me.tabAfterPurchase.SetFocus Not a lot to see... if I comment out these three lines I still get the same error. Any thoughts? 0 Question by:classnet Facebook Twitter LinkedIn Google LVL 61 Active today Best Solution bymbizup If this "just started happening" - ie: with no recent design or code changes - then it is possible that your form is corrupt. First - make a backup Then compact/repair the database. If that Go to Solution 9 Comments LVL 61 Overall: Level 61 MS Access 60 MS Applications 14 Programming 4 Message Active today Expert Comment by:mbizup2012-10-21 Does the form open normally if you double-click it's name in the database window? Also, do you have any code in the Load, Activate or Current events? And what is in the form's Recordsource property? 0 Message Active 1 day ago Author Comment by:classnet2012-10-21 The form does not open normally... I get a "The expression On Open you entered as the event property setting produced the following error: Syntax error". The RecordSource property references the query qryInputWShow. I can run qryInputWShow fine by itself. There is no code in the Load event and a boat load in the Current ev