473,386 Members | 1,609 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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(Cancel As Integer)
' Set public variable to true to indicate that the report
' is in the Open event
bInReportOpenEvent = True

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

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

' Set public variable to false to indicate that the
' Open event is completed
bInReportOpenEvent = 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 4900
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(Cancel As Integer)
' Set public variable to true to indicate that the report
' is in the Open event
bInReportOpenEvent = True

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

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

' Set public variable to false to indicate that the
' Open event is completed
bInReportOpenEvent = 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_OpenReportError

Just above the End Sub enter
Exit_OpenReportError:
Exit Sub
Err_OpenReportError:
If err.Number <2501 then
msgbox err.number & " " & err.Description
Endif
Resume Exit_OpenReportError
>
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(Cancel As Integer)
' Set public variable to true to indicate that the report
' is in the Open event
bInReportOpenEvent = True

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

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

' Set public variable to false to indicate that the
' Open event is completed
bInReportOpenEvent = 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_OpenReportError

Just above the End Sub enter
Exit_OpenReportError:
Exit Sub
Err_OpenReportError:
If err.Number <2501 then
msgbox err.number & " " & err.Description
Endif
Resume Exit_OpenReportError

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
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...
2
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...
7
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...
1
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...
4
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...
8
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...
3
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...
6
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...
4
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...

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.