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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SendObject using criteria or filter

Status
Not open for further replies.
Jul 15, 2002
17
0
0
US
I am currently trying to write code that will cause a report to be sent via email. I need the code to use linking criteria or filtering like in the OpenReport method but I don't know how to accomplish this using SendObject. Any help would be greatly apprecaited.

Chris Haufschild
 
The sendobject command doesn't support any criteria or options for the report. What you have to do is write code that opens the report in Preview Mode, using DoCmd.OpenReport and providing the whereclause that you desire. Then, call the DoCmd.SendObject with the objecttype of acSendReport and leave the objectname parameter empty. This causes SendObject to send the active report which will get you the desired result. Then your next line of code should close the report

DoCmd.Close acReport, "reportname"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top