Error 2501 Openreport Action 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
Error 2501 Access
Posts Go to Page... Page 1 of 2 1 2 > the openreport action was canceled access 2007 Thread Tools Rating: Display Modes 02-05-2007, 02:33 PM #1 ShanVel ShanMug Join Date: Oct 2005 Location:
The Openreport Action Was Canceled Access 2003
Akron, 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 the openreport action was canceled access 2010 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 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 ms access error 2501 the openform action was cancelled 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 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
be down. Please try the request again. Your cache administrator is webmaster. Generated Tue, 11 Oct 2016 02:34:21 GMT by s_ac15 (squid/3.5.20)
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 below. Results http://www.dbforums.com/showthread.php?1215163-Run-time-Error-2501 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 to Threaded Mode 04-06-06,18:55 #1 nckdryr View Profile View https://www.experts-exchange.com/questions/27451886/run-time-error-2501-open-report-action-cancelled.html 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. One user has been action was 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 as far as I know, only he) action was canceled 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, custom, unique programs - Office, VBA, .NET _________________________________________________ Favorite message from Windows:
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 open report action cancelled Want to Advertise Here? Solved run time error 2501 open report action cancelled Posted on 2011-11-16 MS Access 2 Verified Solutions 13 Comments 582 Views Last Modified: 2012-05-12 hello - i have attached sample db- open it and a form comes up. if you click on 'view time clock'- a box opens form query and asks for start date- If a user hits cancel and does not enter date- the runtime error 2501 open report action cancelled comes up- and if user then does not click END- and clicks DEBUG- they are into the code of the form- - Is there a way to stop this from happening?? So they cannot get into the code? thank you example-a1.accdb 0 Question by:davetough Facebook Twitter LinkedIn Google LVL 75 Active today Best Solution byDatabaseMX (Joe Anderson - Access MVP) With error trapping ... just in case some other error occurs: Private Sub ListReport_Click() On Error Resume Next ' in case User Cancels .... DoCmd.OpenReport Me.ListReport, acViewPreview Go to Solution 13 Comments LVL 75 Overall: Level 75 MS Access 75 Message Active today Expert Comment by:DatabaseMX (Joe Anderson - Access MVP)2011-11-16 Quick fix .... change code to: Private Sub ListReport_Click() On Error Resume Next ' in case User Cancels .... DoCmd.OpenReport Me.ListReport, acViewPreview Err.Clear End Sub 0 LVL 75 Overall: Level 75 MS Access 75 Message Active today Accepted Solution by:DatabaseMX (Joe Anderson - Access MVP)2011-11-16 With error trapping ... just in case some other error occurs: Private Sub ListReport_Click() On Error Resume Next ' in case User Cancels .... DoCmd.OpenReport Me.ListReport, acViewPreview If Err.Number = 0 Or Err.Number = 2501 Then ' ignore Else MsgBox "Unexpected error " & Err.Number & " " & Err.Description End If Err.Clear End Sub mx 0 LVL 61 Overall: Level 61 MS Access 60 Message Active today Assisted Solution by:mbizup2011-11