Email a single page from a multi-page report (1 Viewer)

harix

Registered User.
Local time
Today, 22:27
Joined
Jul 21, 2000
Messages
14
1. Whew, my brain is dead!! I generate one large report that gives the teacher's name and e-mail address as the form/report page header and a list of their students and student grades as the body/detail of the page. So each teacher gets one page of the 1000 plus page report.

Since I have the teacher's e-mail address as part of the group/page header I want to E-mail the teacher their student's info contained on that page.


Do I have to create 1000 reports or forms and then set an event procedure to SendObject. I haven't done a loop in VB in years. Any further suggestions? Or, should I read up on VB???

Thanks for your time and interest!!
 

Glen

New member
Local time
Today, 22:27
Joined
Jul 12, 2000
Messages
8
Hope this helps - a little while ago I had a similar problem where I had to hive off different sections of a report to different people. The code I used is below, which splits the report and outputs the seperate sections of the report into unique rtf files on the "c" drive. Obviously you will need to modify it some, and it does seem a bit long-winded - but I hope it points you in the right direction and helps some !! Good luck.

dim rpt as report
dim rs as recordset
Set rs = currentdb.openrecordset("fieldname from tablename", dbopenforwardonly)

Do
docmd.openreport "reportname", acviewdesign
set rpt = Reports("reportname")
rpt.filter ="fieldname="&rs!filedname
rpt.filteron = true

docmd.outputto acoutputreport, "reportname", "rich text format", c:\"&rs!fieldname & ".rtf"
docmd.close acreport, "reportname", acsaveno
rs.movenext
loop until rs.eof

end sub
 

Users who are viewing this thread

Top Bottom