Error 2501 The Openreport Action Was Canceled
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 access 2003 the openreport action was canceled > Thread Tools Rating: Display Modes 02-05-2007, 02:33 PM #1 ShanVel ShanMug ms access openreport action cancelled Join Date: Oct 2005 Location: Akron, OH, USA Posts: 51 Thanks: 0 Thanked 0 Times in 0 Posts Run-time error
The Openreport Action Was Canceled Access 2007
2501; OpenReport action was cancelled 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
The Openreport Action Was Canceled Access 2010
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 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 ms access error 2501 the openform action was cancelled 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 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
Ask a Question Need help? Post your question and get tips & solutions from a community of 418,509 IT Pros & Developers. It's quick & easy. Error 2501 The OpenReport action was cancelled... HELP! P: n/a fearblanco Hello
Access Run Time Error 2501 Outputto Action Was Canceled
- I am receiving the below error message when attempting to open a report. This access 2010 error 2501 database is used by approximately 20 users and only one user is having this problem (even I can't duplicate this error on my own error 2501 access PC). The command being used is DoCmd.OpenReport "rptSYS_ChangeInARDaily", acViewPreview OR DoCmd.OpenReport "rptSYS_ChangeInARDaily", acViewPreview, , "Collector= '" & cmbAnalyst.Value & "'" This one particular user gets the following message: Error: 2501 - ErrorDesc: The OpenReport action was canceled Can http://www.access-programmers.co.uk/forums/showthread.php?t=122481 anybody explain why this would happen to only one person? The data is there, so I can't see why the report would cancel. Please help, fe********@gmail.com Nov 13 '05 #1 Post Reply Share this Question 5 Replies P: n/a Salad fe********@gmail.com wrote: Hello - I am receiving the below error message when attempting to open a report. This database is used by approximately 20 users and only one user is having this problem (even I can't duplicate https://bytes.com/topic/access/answers/204846-error-2501-openreport-action-cancelled-help this error on my own PC). The command being used is DoCmd.OpenReport "rptSYS_ChangeInARDaily", acViewPreview OR DoCmd.OpenReport "rptSYS_ChangeInARDaily", acViewPreview, , "Collector= '" & cmbAnalyst.Value & "'" This one particular user gets the following message: Error: 2501 - ErrorDesc: The OpenReport action was canceled Can anybody explain why this would happen to only one person? The data is there, so I can't see why the report would cancel. Please help, fe********@gmail.com It's possible you have the OnNoData to cancel the report or you have a Cancel in the OnOpen event. If so, in the calling form, add to your error routine If Err.Number <> 2501 then msgbox Err.Description Resume YourExitStatementLine Nov 13 '05 #2 P: n/a fearblanco This would make sense but the other 19 people using the same exact report dont have this problem. and there is no OnNoData event or OnOpen event for this report. I'll try what suggested and hope it works :) Nov 13 '05 #3 P: n/a Salad fe********@gmail.com wrote: This would make sense but the other 19 people using the same exact report dont have this problem. and there is no OnNoData event or OnOpen event for this report. I'll try what suggested and hope it works :) Open your code window and to to the DoCmd.OpenReport "rptSYS_ChangeInARDaily", acViewPreview line. On the vertical bar, click on it so you can step through the process. Then exec
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 http://www.dbforums.com/showthread.php?1215163-Run-time-Error-2501 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 Mode Switch to Hybrid Mode Switch http://www.pcreview.co.uk/threads/run-time-error-2501-openreport-action-was-cancelled.2532010/ 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 with access. The database is stored on the action was 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 pull up a report that is based on a query that has its action was canceled 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 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 a
First let me start by saying I googled this question, which is probably a common one, and tried everything without success. When I open a report with no data from my form "frmAllReports" it goes to the report open and cancels on no data. Fine so far. Then when it returns I get the error msg. Here is my form code: Public Sub cmdReports_Click() On Error GoTo Err_cmdReports_Click On Error Resume Next 'I added this on the advice of someone in newsgroup - no help DoCmd.OpenReport stDocName, acPreview 'stDocName is a public variable that works fine unless no data Exit_cmdReports_Click: Exit Sub Err_cmdReports_Click: If Err.Number = 2501 Then Resume ExitHere MsgBox "Error Number: " & Err.Number & vbCrLf & Err.Description Resume ExitHere End Sub Nothing has changed with Access - it is on a single pc and the db is still in development. Any ideas?? -- Damon Heron Damon Heron, May 4, 2006 #1 Advertisements '69 Camaro Guest Hi, Damon. > Any ideas?? You don't have the ExitHere label defined, and you have several other errors. Try: Err_cmdReports_Click: If Err.Number = 2501 Then GoTo ExitHere MsgBox "Error Number: " & Err.Number & vbCrLf & Err.Description ExitHere: Err.Clear End Sub HTH. Gunny See http://www.QBuilt.com for all your database needs. See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials. http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info. "Damon Heron" <> wrote in message news:... > First let me start by saying I googled this question, which is probably a > common one, and tried everything without success. > When I open a report with no data from my form "frmAllReports" it goes to > the report open and cancels on no data. Fine so far. Then when it > returns I get the error msg. Here is my form code: > Public Sub cmdReports_Click() > On Error GoTo Err_cmdReports_Click > On Error Resume Next 'I added this on the advice of someone in newsgroup - > no help > > DoCmd.OpenReport stDocName, acPreview 'stDocName is a public variable > that works fine unless no data > > Exit_cmdReports_Click: > Exit Sub > > Err_cmdReports_Click: > If Err.Number = 2501 Then Resume ExitHere > MsgBox "Error Number: " & Err.Number & vbCrLf & Err.Description > Resume ExitHere > > End Sub > > Nothing has changed with Acce