Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending a form to email.

Status
Not open for further replies.

Smoores

Programmer
Jun 5, 2002
9
CA
I have a report that is to be emailed to a remote user when ever it is updated. I've tried to put the code on the close-event of the report but I get an error (2585?)that states the action cannot be performed while processing a form or report event. If I close the report before this request, Access won't have the information to generate the report (will it?).
Any help would be appreciated.

PS- Access2000, Outlook2000
 
how is the report called, is it from a form or the switchboard?? if it's from a form, i may be able to help, if it's from the switchboard i can't help...

--James
JHauge@jmjpc.net
Life is change. To deny change is to deny life.
 
junior1544
The report is called from a form.
 
ok, that makes it a little easier...

here is an example of simple code to bring up a report, i'm assuming this looks close to what you are using...

DoCmd.OpenReport strRptName, acViewNormal

now, what you will need to do is instead of running it in acViewNormal i would suggest making that different, like

DoCmd.SendObject acSendReport, "active visitor roster", acFormatRTF, "someone@somewhere.com", , , "subject line", "text to be in the body"

that'll make an email and do a bunch of the work for you... now i can't realy help more then that, but that'll get you well on your way... one thin i need to note, you may need to rework your report a little, because this way you can't send any aurguments to the report to run... but i've had things like this befor, where i set the row source in code in the on open of the report to a sql statment making reference to any of the fields that have data that are required filters... just a coupld things for you...

--James JHauge@jmjpc.net
Life is change. To deny change is to deny life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top