Closing a report after emailing.

G

Guest

I am using Access 2002 to produce invoices which are emailed to clients.
When I have completed the data entry using an Input form I press a button on
the form, which calls up a VBA Event, which starts with :

DoCmd.OpenReport stDocName, acViewPreview

This opens the invoice in report format ready for emailing. I then use:

DoCmd.SendObject acSendDataAccessPage, stDocName, acFormatRTF, stTo, , ,
"Invoice No. " & stInvoice, strMsgBody

This attaches the report as an RTF file to the email with the desired
message, which I can then send. When I press the send button the email
closes and I return to the Access view of the report which I then have to
close manually.

What I would like to do is after sending the email, to have the report
automatically close so I return to the input screen ready to send the next
emailed invoice. I am sure it is simple but I cannot seem to get it to work.

Any help appreciated.
 

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

Similar Threads


Top