Hello,
I create a report and put the following VBA code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
MsgBox "hello"
End Sub
In VBA, I put debugging break on Msgbpx line. Then I open the report for
preview, and the code breaks as it should. But then when I print from the
preview, the code runs and I see another "hello", but it does not break.
If I print the report without preview, it also does not break, though it
shows the message, so the code does run.
Why it does not break?
thanks
Alex Dybenko - 15 Feb 2007 19:14 GMT
Hi,
same here, but no idea why this happens
perhaps report print has a special mode, not breakable

Signature
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
> Hello,
>
[quoted text clipped - 14 lines]
>
> thanks
Vadim Rapp - 15 Feb 2007 19:56 GMT
AD> same here, but no idea why this happens
AD> perhaps report print has a special mode, not breakable
I see what's even more interesting is that errors are quietly ignored. Try
this:
==================
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
On Error GoTo Er
MsgBox "starting"
CurrentProject.Connection.Execute ("bogus") ' should result in error
MsgBox "OK"
Exit Sub
Er:
MsgBox "error"
End Sub
==================
It shows "starting", but then neither "OK", nor "error"...
aaron.kempf@gmail.com - 20 Feb 2007 00:37 GMT
yeah I've noticed this before
I would just make sure you don't raise an error in this section
because it will be sunk
I mean.. make it so that no matter what it does it won't error
we had to use this detail_print event for some 'checkprinting'
application many many years ago
it's really not that big of a deal; just a quirk.. right?
> AD> same here, but no idea why this happens
> AD> perhaps report print has a special mode, not breakable
[quoted text clipped - 15 lines]
>
> It shows "starting", but then neither "OK", nor "error"...