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

Email a report with subreports

Status
Not open for further replies.

redaccess

MIS
Aug 2, 2001
110
US
When I try to email a report that contains subreports I get an error message saying "The Save As command can't process any subreports contained in your report". Is there any way to email in RTF reports that include subreports? I'm using access 97 and outlook.
Thanks.
 
Yeah, I've tried that command

DoCmd.SendObject acsendquery, "rpt_Incident", acformatRTF, "Darin Hanson"

I've also tried using code to open Outlook and create an outgoing message with the report as an attachment.

Dim olApp As New Outlook.Application
Dim olNameSpace As Outlook.NameSpace
Dim olMail As Outlook.MailItem
Dim strWhere As String
Set olNameSpace = olApp.GetNamespace("MAPI")
Set olMail = olApp.CreateItem(olMailItem)
FindX = Emailnumber
strFileName = "filename"
strWhere = "Emailnumber=" & FindX
DoCmd.OpenReport "rpt_Incident", acViewPreview, , strWhere
DoCmd.OutputTo acOutputReport, "rpt_Incident", acFormatRTF, strFileName, False

DoCmd.Close

pstrEmailName = InputBox("Please enter your email destination", "Email")

pstrccName = InputBox("Enter CC address", "CC")
pstrComment = InputBox("Enter comments for your email", "Comments")

With olMail
.To = pstrEmailName
.CC = pstrccName
.Subject = "Incident Report #" & Case__
.Body = pstrComment
.Attachments.Add strFileName
.ReadReceiptRequested = False
.Send
End With
Kill strFileName

Both of these ways work with a report that doesn't have subreports. What needs to be done differently to email a report WITH subreports?

 
start with outlook open.
then try
docmd.sendobject acSendReport,...

on my last job, we e-mailed about 20 reports every morning and they all contained several subreports.
 
another idea, print the report to a pdf, and then email that... just a thought though...

--Junior JHauge@jmjpc.net
Life is change. To deny change is to deny life.
 
Have you tried making the report as a snapshot? and then sending it. The user on the other end will need the Snapshot viewer loaded.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top