Re: Closing a report after emailing.

From: Daniel (IDontHaveOne_at_nowhere.com)
Date: 11/11/04


Date: Wed, 10 Nov 2004 21:26:08 -0500

Try docmd.close

"Pete in France" <PeteinFrance@discussions.microsoft.com> wrote in message
news:6F9EBADB-3FE9-442F-8609-C3422B7E097A@microsoft.com...
> 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.
>
>
>