473,698 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Open Report Action Canceled Error Message

I have reviewed the many postings on this topic and understand the
principle, but am not sure where in my case to apply trapping an error.
I have created a form to supply parameters to a report. I click on the
command button to open the report, the form opens as it should and the
parameters are entered. Upon clicking on "OK," the underlying query is
executed. It is at this point, the the error message appears. The
dialog box disappers as it should, the results from the query appear
(instead of the report) with the correct data, and the error message.
The error message also pops up if I hit "Cancel" from the dialog box.

The code to open the report and form is as follows:

Private Sub Report_Open(Can cel As Integer)
' Set public variable to true to indicate that the report
' is in the Open event
bInReportOpenEv ent = True

' Open Pending Orders by CCR Dialog
DoCmd.OpenForm "Select Pending Orders", , , , , acDialog

' Cancel Report if User Clicked the Cancel Button
If IsLoaded("Selec t Pending Orders") = False Then Cancel = True

' Set public variable to false to indicate that the
' Open event is completed
bInReportOpenEv ent = False
End Sub

Should the trap error code be here or associated with the command
buttons on the dialog box or the command button on the switchboard that
calls up the report?

As always, any suggestions would be appreciated.

Miguel

Jul 13 '06 #1
2 4919
Miguel wrote:
I have reviewed the many postings on this topic and understand the
principle, but am not sure where in my case to apply trapping an error.
I have created a form to supply parameters to a report. I click on the
command button to open the report, the form opens as it should and the
parameters are entered. Upon clicking on "OK," the underlying query is
executed. It is at this point, the the error message appears. The
dialog box disappers as it should, the results from the query appear
(instead of the report) with the correct data, and the error message.
The error message also pops up if I hit "Cancel" from the dialog box.

The code to open the report and form is as follows:

Private Sub Report_Open(Can cel As Integer)
' Set public variable to true to indicate that the report
' is in the Open event
bInReportOpenEv ent = True

' Open Pending Orders by CCR Dialog
DoCmd.OpenForm "Select Pending Orders", , , , , acDialog

' Cancel Report if User Clicked the Cancel Button
If IsLoaded("Selec t Pending Orders") = False Then Cancel = True

' Set public variable to false to indicate that the
' Open event is completed
bInReportOpenEv ent = False
End Sub

Should the trap error code be here or associated with the command
buttons on the dialog box or the command button on the switchboard that
calls up the report?
In the switchboard that called it most likely. If you are working with
a Access generated switchboard you may need to dig to find the problem.

But what the heck, why not create an error routine here. Under your sub
line enter
On Error goto Err_OpenReportE rror

Just above the End Sub enter
Exit_OpenReport Error:
Exit Sub
Err_OpenReportE rror:
If err.Number <2501 then
msgbox err.number & " " & err.Description
Endif
Resume Exit_OpenReport Error
>
As always, any suggestions would be appreciated.

Miguel
Jul 13 '06 #2
Thank you for the response. I will follow your suggestion and see what
happens.

Miguel
salad wrote:
Miguel wrote:
I have reviewed the many postings on this topic and understand the
principle, but am not sure where in my case to apply trapping an error.
I have created a form to supply parameters to a report. I click on the
command button to open the report, the form opens as it should and the
parameters are entered. Upon clicking on "OK," the underlying query is
executed. It is at this point, the the error message appears. The
dialog box disappers as it should, the results from the query appear
(instead of the report) with the correct data, and the error message.
The error message also pops up if I hit "Cancel" from the dialog box.

The code to open the report and form is as follows:

Private Sub Report_Open(Can cel As Integer)
' Set public variable to true to indicate that the report
' is in the Open event
bInReportOpenEv ent = True

' Open Pending Orders by CCR Dialog
DoCmd.OpenForm "Select Pending Orders", , , , , acDialog

' Cancel Report if User Clicked the Cancel Button
If IsLoaded("Selec t Pending Orders") = False Then Cancel = True

' Set public variable to false to indicate that the
' Open event is completed
bInReportOpenEv ent = False
End Sub

Should the trap error code be here or associated with the command
buttons on the dialog box or the command button on the switchboard that
calls up the report?

In the switchboard that called it most likely. If you are working with
a Access generated switchboard you may need to dig to find the problem.

But what the heck, why not create an error routine here. Under your sub
line enter
On Error goto Err_OpenReportE rror

Just above the End Sub enter
Exit_OpenReport Error:
Exit Sub
Err_OpenReportE rror:
If err.Number <2501 then
msgbox err.number & " " & err.Description
Endif
Resume Exit_OpenReport Error

As always, any suggestions would be appreciated.

Miguel
Jul 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2244
by: Niranjan | last post by:
I have a relatively straight forward report. The query that populates data for this report is complicated. The report opens without any problem and I can print it as well. However, If I have another form open (has about 12 combo boxes) and then I run the report, it appears on the screen, no problem. When I print the report, I get 'Cant open any more databases' error. I am using OpenQuery method to run some queries before opening the...
2
14107
by: John Phelan-Cummings | last post by:
After creating a button on a (parent) form linking to another (child) form, I received the following error when clicking on the command button: "The OpenForm action was canceled" No the child form is not a subform. I should also add that I created code in the properties window stating that the "child" "number" field on the form (that I was navigating to),
7
1872
by: simonmarkjones | last post by:
Hi, I have a report i would like created based upon a date the user types in. I have a query which in the criteria section of my date field i have put . The report is created fine when a valid (a date that is in the table) is entered. However, is it possible to display a message to the user when the date is not found and then not display the report?
1
1977
by: Dumitru Ozunu | last post by:
Hello, I have a strange problem, I've browsed the whole newsgropu but I found no answer :-( I have a web page that contains a submit button (asp .net) when submited, it makes a redirect to a page containing a IFRAME. sometimes the IFRAME loads the page that it references without problems, sometimes I get a nasty error: "Action canceled. Page could not be loaded", but the page exists on my server and I can see it in my browser when I...
4
5131
by: Jit Prasad | last post by:
I have a working client-side Vb.Net (.net v1.0) app that talks to a Webspere webservice on a windows 2000 server. The client side app runs on a citrix server, also a Windows 2000 server. The app worked ok till I installed .Net v1.1 on the citrix, now I get an error when I get the app to use .NET v1.1. If the app uses .NET v1.0 (with .NET v1.1 stalled), then its ok, however I must use v1.1 for other reasons. Has somebody come across...
8
4483
by: someone | last post by:
I'm making an program that encodes text, and then writes it into another text file. The problem is that I can't seem to get the "file exists" checking right. If I use the command (coder is the application): coder something.txt an_exsiting_file.txt, then if I chose to overwrite "an_exsiting_file.txt", an error message pops up, saying that to many files are open <EMFILE>. Any help would be appreciated. Here is the code (incomplete but still...
3
2254
by: e name | last post by:
Hello, I am getting "Action Cancelled" message on an asp page which is running a process that takes more then 25 minutes. I have "Friendly error message" turned off on browser setting. And what happens is this process processes a huge xml file size of 4mb which is passed to the com object located on Application Server as xmlElement from asp page on Webserver. The process finishes successfully after 29 min but try to re run by itself
6
2900
by: martin DH | last post by:
**Urgent Need** I'll throw out the basics and any assistance is very, very, very much appreciated! Access 2003 on XP On a form (frmMain) is an option group of check boxes (ReportFrame) from which a user can choose a specific report to generate. The user selects the report of choice then presses a comand button (CmdRunRpt). The command button runs using the code below: Private Sub CmdRunRpt_Click() If ReportFrame = 1 Then...
4
9664
by: Phil Stanton | last post by:
I am opening a report (in Preview) from a menu system I use the following code if there is no data in a report Private Sub Report_NoData(Cancel As Integer) MsgBox "There are no errors in Membership Head of Families", vbInformation Cancel = True
0
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7739
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.