[RESOLVED] Auto email from access
I need to write a macro within microsoft access which will run one of my predefined reports & then email it.
I have the report set up within access.
How can i write a macro to send the report and auto email.
I'm using access 2000 and i also can use access 2003.
thanks
Re: Auto email from access
Access VBA question moved to Office Development
Re: Auto email from access
docmd.SendObject acSendReport,"ReportName", acFormat....,To,CC,BCC,Subject, Message, etc....
Re: Auto email from access
Thanks Static - do i use public function first?
Re: Auto email from access
No, you'd put that in a sub, not a function, unless you maybe wanted to return a boolean value indicating success or failure, or in the click event of a button. Or, call the function from the click eventShouldn't be public unless called from more than one spot. The function could take ReportName, to, cc, subject, etc, as arguments to make it more generic.
You could do it in a macro, but I suggest avoiding macros like the plague.
Re: Auto email from access
agreed.. NO MACROS unless u have to!! (or if u need a startup macro)