From: rjpohl on
I have an access 2003 form with entries that are used to make 2 separate
reports. I want to place a command button on the form to have both reports
attached to one email.

thanks for your help
--
rjpohl
From: ghetto_banjo on
you can do it, but (as far as i know) you cannot use the usual
DoCmd.SendObject

I believe you would need to use DoCmd.OutputTo, and save both reports
to a particular folder location. Then you can build an email in VBA
and attach those 2 documents.

so the OutputTo command would look like this (create the directory
first):

DoCmd.OutputTo acOutputReport, "rptTest", acFormatSNP, "C:\TempDir
\rptTest.snp"
DoCmd.OutputTo acOutputReport, "rptTest2", acFormatSNP, "C:\TempDir
\rptTest2.snp"



Then here is the code for creating the email:

Dim OlApp As Object
Dim OlMail As Object

Set OlApp = CreateObject("Outlook.Application")
Set OlMail = OlApp.createitem(olmailitem)

OlMail.Recipients.Add "test(a)whatever.com"

OlMail.Subject = "Here are your 2 reports"

OlMail.Body = "Please see attachments"

OlMail.Attachments.Add "C:\TempDir\rptTest.snp"
OlMail.Attachments.Add "C:\TempDir\rptTest2.snp"

OlMail.Display 'change this to OlMail.Send if you just want to send it
without previewing it
From: De Jager on

"rjpohl" <rjpohl(a)discussions.microsoft.com> wrote in message
news:1C858A08-BC2C-4EDD-A37F-908B7852C37E(a)microsoft.com...
>I have an access 2003 form with entries that are used to make 2 separate
> reports. I want to place a command button on the form to have both
> reports
> attached to one email.
>
> thanks for your help
> --
> rjpohl

From: joelgeraldine on
nnxxnbbb

"rjpohl" <rjpohl(a)discussions.microsoft.com> a écrit dans le message de
groupe de discussion : 1C858A08-BC2C-4EDD-A37F-908B7852C37E(a)microsoft.com...
> I have an access 2003 form with entries that are used to make 2 separate
> reports. I want to place a command button on the form to have both
> reports
> attached to one email.
>
> thanks for your help
> --
> rjpohl