How to send multiple reports via email in Access 2007?

Hi everyone,

I know that the DoCmd.SendObject code cannot send multiple attachments in an email and I haven't found a clear way of doing this.  I basically have two reports that I want to send out to one recipient.  I'd ideally like to also be able to take a date from a form I have in my database and input it in the subject line.

Can someone help me code this?  I'm more of a novice wit VB coding so any help would be greatly appreciated.  
LVL 1
Anthony6890Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
this can be done by
1. saving the reports in acFormatRTF or acFormatPDF

you can use this code to output the report to a folder

DoCmd.OutputTo acOutputReport, "Customer Address Book", acFormatRTF, CurrentProject.Path & "\Customer Address Book.rtf", True

2. Now you create a mail with attachment

see this link

http://support.microsoft.com/?kbid=209948


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Anthony6890Author Commented:
Ok, I was able to do that.

Do you know how I can reference a form field in the subject line of my email with the vb code?
0
Rey Obrero (Capricorn1)Commented:
did you look at the link i posted above ?

change this line

   .Subject = "This is an Automation test with Microsoft Outlook"

with

    .Subject = Forms!NameofForm!ControlName
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Anthony6890Author Commented:
Yeah I saw that,

here is what I have, but it's not compiling correctly:

.Subject = "Department and Employer Changes For Dates" Forms!RUNDTEf.SPEC_START "-" Forms!RUNDTEf.SPEC_END
0
Anthony6890Author Commented:
I was able to get it:

.Subject = "Department and Employer Changes For Dates " & [Forms]![RUNDTEf].[SPEC_START] & " - " & [Forms]![RUNDTEf].[SPEC_END]

Do you know how I can make the .Body message longer?  Like having multiple lines?
0
Rey Obrero (Capricorn1)Commented:
.Subject = "Department and Employer Changes For Dates " & Forms!RUNDTEf.SPEC_START & "-" & Forms!RUNDTEf.SPEC_END
0
Rey Obrero (Capricorn1)Commented:
You already have asked too much for a single thread. Post another Q for your other problem
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.