You don't have the ExitHere label defined, and you have several other errors. Finally, you had your GoTo labels "cmb" instead of "cmd"... I hope this helps someone because I was at a loss when it first occurred. Jun 3 '10 #3 reply Expert 100+ P: 931 patjones I would suggest putting a break somewhere near the top of the subroutine and stepping through it from that point to http://downloadcallwave.com/action-was/access-run-time-error-2501-openform-action-cancelled.php
I didn't do a good job of copying my code, but it wasn't working and wouldn't work with your code either, because I discovered the real problem - in the tools/options 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: it's the cancel button that's the problem. It has to be used with great care. website here
That is why stepping through the code may help. In this case, a string seems preferable to me. –David-W-Fenton Sep 30 '09 at 2:49 add a comment| up vote 0 down vote Check your default printer. 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.
A quick test to see if the printer is issuing the cancel command is to just swap your default printer preference to the microsoft image writer printer (or another working printer) pbaldy View Public Profile Find More Posts by pbaldy 02-05-2007, 05:01 PM #10 Wiz47 Learning by inches ... I tried to trap this on the report's "on close, on error, on open, on no data" and nothing seems to work. The Openreport Action Was Canceled Access 2003 I tried to trap this on the report's "on close, on error, on open, on no data" and nothing seems to work.
It's quick & easy. Access 2010 Error 2501 Please help, email@example.com Nov 13 '05 #1 Post Reply Share this Question 5 Replies P: n/a Salad firstname.lastname@example.org wrote: Hello - I am receiving the below error message when attempting to Hope it works for you. Expand|Select|Wrap|Line Numbers DoCmd.OpenReport"EmployeeReport",acViewPreview,,"tblEmployees.fldDateOfBirthBETWEEN#12/31/1984#AND#1/1/1986#" As you can see, the filter criteria is passed in as a string, and it's not hard to see how you can call the report with different criteria
Attached Files DemoErr2501A2000.zip (16.5 KB, 1001 views) Reply With Quote 11-08-07,11:52 #5 pc_tim View Profile View Forum Posts Registered User Join Date Nov 2007 Location Wisconsin Posts 1 I had this Run-time Error 2501 The Close Action Was Cancelled The Following User Says Thank You to boblarson For This Useful Post: Matt_Lavoie(09-15-2011) boblarson View Public Profile Visit boblarson's homepage! This is generally how a report is filtered. 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: There
After your suggestions, I put the code like this: On Error GoTo CancelError If Not IsNull(vFilter) Then DoCmd.OpenReport vBerichtName, nAnsicht, , vFilter Else DoCmd.OpenReport vBerichtName, nAnsicht End If CancelError: DoCmd.Close acReport, Try this: Expand|Select|Wrap|Line Numbers PrivateSubcmdreport_Click() OnErrorGoToErr_cmdreport_Click DimstDocNameAsString DimstLinkCriteriaAsString IfMe.grpreports=6Then DoCmd.Close stDocName="designtype" DoCmd.OpenFormstDocName,,,stLinkCriteria ElseIfMe.grpreports=1Then DoCmd.Close DoCmd.OpenReport"rawdataforabar",acViewReport EndIf Exit_cmdreport_Click: ExitSub Err_cmdreport_Click: IfErr.Number=2501Then Ms Access Error 2501 The Openform Action Was Cancelled boblarson View Public Profile Visit boblarson's homepage! Access Run Time Error 2501 Outputto Action Was Canceled 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.
Join Now For immediate help use Live now! Check This Out Maybe there is something being done that stops aborts the code. Pat Jun 3 '10 #6 reply P: 31 tomric Yes that is correct, the report will run just fine. Once I changed that, everything is back to normal. The Openreport Action Was Canceled Access 2010
The database is stored on the network drive and is accessed by multiple users. ms-access report share|improve this question asked Sep 29 '09 at 12:26 faboolous 1,46422553 add a comment| 4 Answers 4 active oldest votes up vote 2 down vote accepted Ditto to Phillipe's Can you post a sample db? __________________ Paul Microsoft Access MVP To view links or images in signatures your post count must be 10 or greater. Source Fine so far.
All rights reserved. Run Time Error 2501 The Runmacro Action Was Canceled I fixed the line to Err.Number, still same message Error 2501 When I click 'Debug' button it always takes to this line of code: DoCmd.OpenReport "rptBlrSrchItem1", acViewPreview ShanVel View Public Sep 29 '09 at 18:52 add a comment| up vote 1 down vote The error probably comes from the DoCmd.OpenReport line.
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 P: n/a fearblanco Hello - I am receiving the below error message when attempting to open a report. The time now is 21:15. The Openform Action Was Canceled Access 2013 I don't see that event listed for a report?
There are other ways to get 2501, almost all of them involve canceling an operation. Wiz47 View Public Profile Find More Posts by Wiz47 Page 1 of 2 1 2 > « Previous Thread | Next Thread » Thread Tools Show Gunny See http://www.QBuilt.com for all your database needs. have a peek here The easiest way to accomplish this is using a criteria form that a… MS Access Visual Basic Classic MS Access – Repeating Sub-Report Headings on Each Page Video by: Jim In
ShanVel View Public Profile Find More Posts by ShanVel 02-06-2007, 03:27 PM #13 boblarson Former Moderator Join Date: Jan 2001 Location: Oregon, USA Posts: But the confusing part that got me initially was that I was trying to figure out what code generated it. Last edited by Wiz47; 02-05-2007 at 03:06 PM.
© Copyright 2017 downloadcallwave.com. All rights reserved.