Access Runtime Error 2501 Openreport
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 access runtime error 2501 the openform action was cancelled to Page... Page 1 of 2 1 2 > Thread ms access runtime error 2501 Tools Rating: Display Modes 02-05-2007, 02:33 PM #1 ShanVel ShanMug Join Date: Oct 2005 Location: Akron, microsoft access runtime error 2501 OH, USA Posts: 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
Access 2010 Runtime Error 2501
of postings on 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 ms access error 2501 the openform action was cancelled = 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 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
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 the selection access run time error 2501 outputto action was canceled below. Results 1 to 7 of 7 Thread: Run-time Error '2501' Tweet Thread Tools Show Printable
Access 2010 Error 2501
Version Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 04-06-06,18:55 #1 nckdryr
The Openreport Action Was Canceled Access 2010
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 accessed by multiple users. http://www.access-programmers.co.uk/forums/showthread.php?t=122481 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 that makes sense). But he (and http://www.dbforums.com/showthread.php?1215163-Run-time-Error-2501 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 Development Consultant Biz db & reports - SQL, Access, Crystal, Seradex and more Small
Ask a Question Need help? Post your question and get tips & solutions from a community of 418,417 IT Pros & Developers. It's quick & easy. Error 2501 The OpenReport action was cancelled... HELP! P: n/a fearblanco Hello - I am https://bytes.com/topic/access/answers/204846-error-2501-openreport-action-cancelled-help 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 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 error 2501 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 this error on my own PC). The command being time error 2501 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 exectute from the bad machine and follow the steps the code takes. See where this program takes you. Somet