Problem sending report with DoCmd.SendObject

  • Thread starter Thread starter Alexander
  • Start date Start date
A

Alexander

I have written code to automatically send some 200 reports via email. I use
a For Each ... statement and send a specified report to different addresses
with DoCmd.SendObject. During programming I often tried the code and it
seemed to work. However, now in a realtime version it sends some reports and
skips most without generating an error message. Due to the absence in that
case of the screen 'Now outputting ReportName to a mail message' I now the
bug must be with Access and not Outlook.

Please suggest to me what could be wrong. Any alternative ways to batch-send
reports would be most welcome.

Alexander
 
Alexander said:
I have written code to automatically send some 200 reports via email. I use
a For Each ... statement and send a specified report to different addresses
with DoCmd.SendObject. During programming I often tried the code and it
seemed to work. However, now in a realtime version it sends some reports and
skips most without generating an error message. Due to the absence in that
case of the screen 'Now outputting ReportName to a mail message' I now the
bug must be with Access and not Outlook.

Please suggest to me what could be wrong. Any alternative ways to batch-send
reports would be most welcome.

You could try a DoEvents in the loop just to give other apps a chance
to catchup.

Is it possible/desirable to send mutliple reports as attachments in
one/several emails rather than 200 individual emails? Are Excel,
Snapshot or PDF files acceptable? If so use an alternative to
docmd.sendobjects such as Outlook and visit the Access Email FAQ at my
website.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
Back
Top