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.