Click button in form, report is attached to e-mail...

thiazi

Registered User.
Local time
Yesterday, 16:57
Joined
Mar 31, 2007
Messages
27
I have several forms working that currently generate working reports. I'm generating the report through DoCmd.OpenReport function, then my report name, then acViewPreview.

What sort of code would I need to put in a command button so when it is clicked on the form itself, the report is automatically generated and attached to an outgoing e-mail? Ideally, without the report ever being presented on the screen, but if it is displayed, that's not a problem.

All of my users will be using Microsoft Outlook, if it matters. Also, I have a combo box on one of the forms that allows the user to pick a person to run the report on. Is there anyway to automatically populate the "To:" line in the email with the persons name (global address book will convert that to their email address automatically)?
 
Look at

DoCmd.SendObject
 
Well that was super easy.. thank you!! When I exited the message and clicked on Cancel, I got a SendObject failed message from Access. Is this normal?
 
Nevermind - it helps to have error handling! :)
 

Users who are viewing this thread

Back
Top Bottom