Solved

Print Preview won't make PDF file with all pictures in the PDF file

Posted on 2014-09-15
5
507 Views
Last Modified: 2014-09-17
I have the following code in an onclick event of a command button.  The problem is that if I do a print preview of the report all of the pictures print on the report.  (There are 5 in total).  But when the report gets send to a PDF file only 3 of the pictures are there.  Two are missing.

Here is the code:

   
Dim strClientFolderName As String
    Dim strFilter As String
    Dim strPropertyAssetFolderName As String
    Dim strPropertyFolderName As String
    Dim strReportName As String

    strClientFolderName = TempVars!strPicturesDataPath & "\" & Trim(Me.cboClientName) & "\"
    strPropertyFolderName = strClientFolderName & Trim(Me.cboProperty) & "\"
    strReportName = "Asset Detail Report"
    
    If Not IsNull(Me.cboFilterBySelectionAsset) Then
        strFilter = "AssetN = " & Me.cboFilterBySelectionAsset
    End If

    DoCmd.OpenReport strReportName, acViewPreview, , strFilter, acHidden
    DoCmd.OutputTo acOutputReport, strReportName, acFormatPDF, strPropertyFolderName & strReportName & ".pdf"
    DoCmd.Close acReport, strReportName, acSaveNo

    FollowHyperlink strPropertyFolderName & strReportName & ".PDF"

Open in new window

0
Comment
Question by:SteveL13
  • 2
  • 2
5 Comments
 
LVL 35

Expert Comment

by:PatHartman
ID: 40325379
Have you tried printing other records?  Is it always the same two controls that are empty?  Will those two pictures print if they are assigned to different controls?  Are the two pictures a different format from the ones that do print?
0
 

Author Comment

by:SteveL13
ID: 40325480
Here's the latest on this quirk.  All of the picture files are jpg file.  But get this...

I can run the report one time and all of the pictures do not appear in the pdf file.  The next time they may all appear.  They always all appear in the print preview.

?????????

Is driving me crazy!
0
 
LVL 26

Accepted Solution

by:
Nick67 earned 500 total points
ID: 40325641
I take it that images are very large?
There are limits to what Access is willing to do with large images on reports.
They can be worked around.
I have an article (actually two) on the subject
http://www.experts-exchange.com/Database/MS_Access/A_13519-Printing-many-large-images-in-MS-Access-reports.html
and
http://www.experts-exchange.com/Database/MS_Access/A_13779-More-Fun-with-Really-Large-High-Fidelity-Images-in-Access-Reports.html

To test and for fun, resize your images down until they are 200 dpi -- that is to say that if the control that displays them is 4 inches by 3 inches, resize the images to 800 x 600 pixels.

Do they then render to PDF?
I'll betcha they do.
If so, then have a look at my articles on the subject.

Nick67
0
 

Author Comment

by:SteveL13
ID: 40325716
How can I resize them down to 200 dpi?
0
 
LVL 26

Expert Comment

by:Nick67
ID: 40325765
Pick your poison.
How large are the originals?
How large are the controls?

For quick and dirty (it doesn't need to be exactly 200 dpi) use resize in MSPaint!
Figure out by what percentage you need to shrink them and have at 'er.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Single Step Macro 4 41
Connecting to MSSQL server from MS Access 5 50
default combobox value 12 18
Command button Click Event running twice on Double Click 9 32
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

791 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