report - no Open event fires - Acc2003

  • Thread starter Thread starter will eichert
  • Start date Start date
W

will eichert

I'm emailing a report via email using DoCmd.SendObject in Access 2003.
It works fine, but I wanted to run some code in an event before the
report is sent. Seems simple enough. For some reason, the events (I've
tried the Open, Activate, even Error) don't seem to happen when the
report is invoked by SendObject. If I just open the report manually, I
get both the Open and the Activate event.

I've searched the archives, but can't find any info on this. Is there
something special I have to do to enable these events? Is this a bug
in Access 2003?

Here's my SendObject command:
DoCmd.SendObject acSendReport, myReport, acFormatRTF,
"myemail@mydomain", , , "email subject", "email body text", false

Thanks for any help,

Will Eichert
 
Sorry about the previous post, it is inaccurate. The Open event is
indeed happening.

I was fooled because my breakpoint in the 1st line of the event code,
was never hit. I still don't know why. Anyway, the code in the Report
event procedures was running. Errors of my own in that code caused an
early exit from the code (although the errors were AFTER the
breakpoint), so coupled with the breakpoint not tripping, I thought
the code was never executing at all.

Will
 
Sorry about the previous post, it is inaccurate. The Open event is
indeed happening.

I was fooled because my breakpoint in the 1st line of the event code,
was never hit. I still don't know why. Anyway, the code in the Report
event procedures was running. Errors of my own in that code caused an
early exit from the code (although the errors were AFTER the
breakpoint), so coupled with the breakpoint not tripping, I thought
the code was never executing at all.

Will
 
Back
Top