Solved

Report as email attachement does not render report pictures

Posted on 2013-10-23
6
431 Views
Last Modified: 2013-10-23
Hello, when I print preview a report if the report contains pictures they display. However, if I use DoCmd.SendObject acReport, stDocName to attach the report to an email the pictures do not render on the report. The pictures are linked and not in the database. On the report I populate the images with the following code.


Why do the images appear when I print the report but not when the report is an attachment to an email?

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
DefaultFilePath = GetDefaultFilePath
    If Me!txt_Picture1 > "" Then
    Me!Picture1.Picture = DefaultFilePath & Me!txt_Picture1
    End If
    If Me!txt_Picture2 > "" Then
    Me!Picture2.Picture = DefaultFilePath & Me!txt_Picture2
    End If
    If Me!txt_Picture3 > "" Then
    Me!Picture3.Picture = DefaultFilePath & Me!txt_Picture3
    End If
   
    
End Sub

Open in new window

0
Comment
Question by:gogetsome
  • 3
  • 3
6 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39594768
...and what is your entire SendObject code?

Perhaps the format you are using does not support images...?
0
 

Author Comment

by:gogetsome
ID: 39594815
Here is my code:
Private Sub btn_Supplier_Click()

On Error GoTo ErrorHandler

Dim emailList As String
Dim qdf As QueryDef
Dim rst As Recordset
Dim myPrice As Currency

Set qdf = CurrentDb.QueryDefs("Get_EmailDistributionListBySupplier")

qdf.Parameters(0) = Me.txt_Supplier.Value

Set rst = qdf.OpenRecordset

If rst.RecordCount > 0 Then

Do Until rst.EOF
   emailList = emailList & rst![email Address] & "; "
   rst.MoveNext
Loop

emailList = Left(emailList, Len(emailList) - 1)

Dim stDocName As String
stDocName = "DMR_Single View"
   
DoCmd.SendObject acReport, stDocName, , emailList

Else

  MsgBox "There are no email addresses in the database for this supplier."
  DoCmd.Hourglass False
  Resume ExitHandler
 
 End If
  
ExitHandler:
Set rs = Nothing
Set db = Nothing
Forms("DMR Tracking").Visible = True
Exit Sub

ErrorHandler:
Select Case Err
Case 2501
Resume ExitHandler
Case Else
Resume ExitHandler
End Select

End Sub

Open in new window

0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 39595108
Again, what output format are you specifying?
Because you left this argument blank in your code, it should popup and ask you for the format...
...In any even, when I select "PDF" as the output format, the images display fine in the resulting, attached PDF file...
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

Author Comment

by:gogetsome
ID: 39595186
You talking about the output format for the attachment?

Yes, a popup does ask a format type; however; pdf is not in the list (access 2003).

This

DoCmd.SendObject acReport, stDocName, pdf, emailList

still gives a popup for the type.

Am I lost here?
0
 

Author Closing Comment

by:gogetsome
ID: 39595409
Thank you boag2000 for the newb time! Since 2003 does not do PDF natively. We are going to force snapshot as the format.

This works perfectly:

DoCmd.SendObject acReport, stDocName, acFormatSNP, emailList
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39595537
oK great
;-)

BTW, what were you using before?
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now