Problem sending report with DoCmd.SendObject

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
 
T

Tony Toews

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top