Microsoft Access Error 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
Ms Access Error 2501 The Openform Action Was Cancelled
Page... Page 1 of 2 1 2 > Thread Tools Rating: access run time error 2501 outputto action was canceled Display Modes 02-05-2007, 02:33 PM #1 ShanVel ShanMug Join Date: Oct 2005 Location: Akron, OH, USA Posts:
Error 2501 Access
51 Thanks: 0 Thanked 0 Times in 0 Posts Run-time error 2501; OpenReport action was cancelled Folks, Need your help. I searched the entire forum and found couple of postings on access 2010 error 2501 this, but none of them indicates if there is any fix for this problem. If there is no data, basically I 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 run time error 2501 the runmacro action was canceled 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 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
FORUMSFOR COMPUTER PROFESSIONALS Log In Come Join Us! Are you aComputer / IT professional?Join Tek-Tips Forums! Talk
Run Time Error 2501 The Save Action Was Canceled
With Other Members Be Notified Of ResponsesTo Your Posts Keyword run time error 2501 the runcommand action was canceled Search One-Click Access To YourFavorite Forums Automated SignaturesOn Your Posts Best Of All, It's Free! Join
Access Runtime Error 2501 Outputto Action Was Cancelled
Us! *Tek-Tips's functionality 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 http://www.access-programmers.co.uk/forums/showthread.php?t=122481 is forbidden.Tek-Tips Posting Policies 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: http://www.tek-tips.com/viewthread.cfm?qid=1453633 Access Forms Forum Runtime 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 line
be down. Please try the request again. Your cache administrator is webmaster. Generated Thu, 20 Oct 2016 13:55:30 GMT by s_wx1085 (squid/3.5.20)
question and get tips & solutions from a community of 418,589 IT Pros & Developers. It's quick & easy. Run time error 2501 P: 31 tomric Hi, I have an option group to select different reports, each report is based off a query that asks for criteria for that report. I have no problem opening any the querys through the group regardless of the data involved. The problem arises when you go to open a report and click the cancel button on the criteria question. I get a "Run Time Error 2501", "The Open Report Action was canceled". The error occurs only on the reoprt in the elseif statement. The grpreport = 6 opens other forms that have the criteria on the form, because there are 14 different criterias the query looks at. The grprrport = 6 also uses a macro for that specific report. The code I used is as to open the reports is as follows: Expand|Select|Wrap|Line Numbers PrivateSubcmdreport_Click() OnErrorGoToErr_cmbreport_Click DimstDocNameAsString DimstLinkCriteriaAsString IfMe.grpreports=6Then DoCmd.Close stDocName="designtype" DoCmd.OpenFormstDocName,,,stLinkCriteria ElseIfMe.grpreports=1Then DoCmd.Close DoCmd.OpenReport"rawdataforabar",acViewReport Exit_cmbreport_Click: ExitSub IfErr.Number=2501Then ResumeNext Else Err_cmbreport_Click: MsgBoxErr.Description ResumeExit_cmbreport_Click EndIf EndIf EndSub The program stops at the DoCmd.openreport line. I won't added the rest of the option buttons for reports untill I get past this problem. Can anyone help me capture the error? Jun 3 '10 #1 Post Reply ✓ answered by patjones I think the way for you to solve this is to determine which set of criteria you need some other way - say by entering it on the form, then passing that criteria to the report using the filter argument of OpenReport. This is generally how a report is filtered. As a simple example of how this works, suppose I have a table called tblEmployees, with fields fldEmplID, fldLastName, fldFirstName, fldDateOfBirth. In the Open event of a report based on this table, I can write, very simply: Expand|Select|Wrap|Line Numbers Me.RecordSource="SELECT*FROMtblEmployees" This will pick everything from the table. But what if you want to restrict t