473,404 Members | 2,137 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,404 software developers and data experts.

report error

Hi
I have a report with 3 subreports where from I take a few value in VBA
On Print event. Some value causes error so i wrote in my procedure
such code:

On Error GoTo err_bl
err_bl:
If Err = 3071 Then
MsgBox "Report contains wrong value!"
Exit Sub
End If

After error I got a msgbox and procedure is ending but report is
opening next.
How to do so that after appearing msgbox report will not open?
Is it possible?

Thanks for any help

Nov 13 '05 #1
3 1485
to**@wp.pl wrote:
Hi
I have a report with 3 subreports where from I take a few value in VBA
On Print event. Some value causes error so i wrote in my procedure
such code:

On Error GoTo err_bl
err_bl:
If Err = 3071 Then
MsgBox "Report contains wrong value!"
Exit Sub
End If

After error I got a msgbox and procedure is ending but report is
opening next.
How to do so that after appearing msgbox report will not open?
Is it possible?

Thanks for any help

I tried to close a report via Docmd.Close and couldn't. Maybe it can be
done, maybe not. Briefly looked in GoogleGroups, but didn't see
anything there either.

Why don't you correct the problem? You could display a messagebox on
the the ID that it blows up on. Then do a
Docmd.OpenReport "YourReport",,,"ID = 123"
and correct it. Start looking in the tables for the data in id 123.
Run the query for the report for ID = 123".

I would suggest that it is your query that is the root of the problem.

You should know what is causing the error so you can trap for it for all
records. Providing a report that may or may not work for users is a bit
useless.
Nov 13 '05 #2
<< I would suggest that it is your query that <<is the root of the
problem.

<< You should know what is causing the <<error so you can trap for it
for all
<< records.

With this report it is a little difficult because I have there three
subreports and every subreport have his own independent query
and I open this report directly with DoCmn.OpenReport from my form but
I will try
Thanks for advice
Piter

Nov 13 '05 #3
to**@wp.pl wrote:
<< I would suggest that it is your query that <<is the root of the
problem.

<< You should know what is causing the <<error so you can trap for it
for all
<< records.

With this report it is a little difficult because I have there three
subreports and every subreport have his own independent query
and I open this report directly with DoCmn.OpenReport from my form but
I will try
Thanks for advice
Piter

If you can get to a single record...one that blows up...then run the SQL
for each report for that record...you will find the problem. Each
subreport is linked on some sort of key. So if the ID is 123, run the
main report recordwource for ID = 123 and do the same for all the
subreports. You should be able to run this from the report while in
design mode if the row source is a Select statement, not a table/query name.
Nov 13 '05 #4

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

Similar topics

3
by: Nicola | last post by:
Hi Everyone, I am new to programming and would like to know how to open an access Report from within vb 6. I am trying to write a program to organise cross stitch threads. I have found out how...
7
by: xzzy | last post by:
I need to automate a report in a different database (and thank yous to Terry Kreft for pointing me in the right direction). below is the code with the one line that does not work, marked: 'Does...
3
by: lorirobn | last post by:
Hello, I have a report which uses a subreport. When I run the report, I get "Enter Parameter Value" error message for "tblGuestRoom". I click ok and the report seems to work fine. I...
2
by: mike_li | last post by:
On Window 2000 Professional Server DB2 UDB Level: DB2 code release "SQL07029" with level identifie "030A0105" and informational tokens "DB2 v7.1.0.98", "n040510" and "WR21337". In the...
2
by: rinmanb70 | last post by:
I have a QBF form/query and a report from the QBF that shows the results of the QBF. I would like to show the criteria on the report that was used in the QBF to get the info on report. I can't...
13
by: Greg | last post by:
Most suggestions on this topic recommend to use a page footer and make it visible only on the last page. My problem is that the footer is half of the height of a page which means the detail would...
1
by: Intrepid_Yellow | last post by:
Hi, I have the following code that runs my report generator. The user selects a table from a combo box, then whatever fields they want from a list box. (This part all works and the report runs...
4
by: Fran | last post by:
I recently tried to use code for "Use a multi-select list box to filter a report" from Allen Browne in my database. I was able to add the code and adapt it to my needs, however I am getting an...
11
by: Gord | last post by:
When I open a certain report, it runs some code that generates the records that will be displayed in that report. This works fine. When I go to print preview the report it appears that the code...
12
smithj14
by: smithj14 | last post by:
I have a form to enter start and end dates then select a worker name to filter a report. This all works fine and when the report is open in preview mode it shows the date range in the txtboxes on the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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,...

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.