Solved

MS Access Report Won't Print to PDF File in Colour

Posted on 2010-08-25
9
1,131 Views
Last Modified: 2013-11-28

I'm using Access 2003 and Windows 7.  I have Acrobat installed as a printer.
I use the VBA code below to print a report to a pdf but the resulting pdf file is always in black and white even though I use colour fonts in my report.  I've set all my Acrobat options to colour manually wherever I can.

Set Application.printer = "Adobe PDF"
Crit$ = "[Invoice_no]= " & Val(frmS![ListBoxInvoice])
DoCmd.OpenReport "rpt_invoice", acNormal, , Crit$

I tried adding Application.printer.ColorMode = acPRCMColor after selecting the printer but still get a black and white PDF only.
If I open my report manually, select the print menu, select 'Adobe PDF' as the printer and print, the resulting pdf is in colour.

I've tried the solution in http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_21597698.html but it doesn't solve my problem.

I get the problem on two different PCs so don't think the problem lies with any corrupt installations.

Can anyone help?  Thanks.




0
Comment
Question by:Supertension
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 46

Expert Comment

by:tbsgadi
ID: 33528638
Have a look at http:Q_20878116.html

Gary
0
 
LVL 57
ID: 33530429
Just to add to Gary's comment a bit (no points please), here's a screen shot of what your looking for.
JimD.

Region-Capture.bmp
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 33532607
<No Points wanted>
If you open the report in *Print Preview*, is it in color or b/w?

This is sometimes a good indication of the printer color settings.

;-)

JeffCoachman
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:Supertension
ID: 33535205
Thanks guys, I've checked the Adobe color property suggested by Gary and JimD and it's set to color ok.

I've checked "Print Preview" as suggested by JeffCoachman and it's in color OK.  If I preview the report, right click, select Print.... then go on to print to a pdf using Adobe, I get a color pdf.  The problem only occurs when I use VBA to automate the pdf creation.

David
 
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 33536836
The code you posted:

Set Application.printer = "Adobe PDF"
Crit$ = "[Invoice_no]= " & Val(frmS![ListBoxInvoice])
DoCmd.OpenReport "rpt_invoice", acNormal, , Crit$

1. Where are you declaring: Crit$ ?
2. AFAICT this code prints an MS Access"Report" to the adobe printer.
It does not explicitly print a specific Adobe PDF document.  To do this, it would seem to need a filename.

But remember, a PDF is basically a stored collection of printer commands (for lack of a better explanation) that it sends to the printer

So printing the Report or printing a PDF (of the same report) will/should result in the exact same output.

For example: if someone handed a hardcopy printout, how would you know if it was a PDF, or an Access Report, or a WordDoc?
;-)


So what happens when you just print the (MS Access) Report?

If that prints in color, then just print the Report.
Then just use the PDF for emailing, distribution, ...etc

;-)

JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 33536869
Clarification:

Change this:
So what happens when you just print the (MS Access) Report?

...to this:

So what happens when you just print the (MS Access) Report to the color printer (not the Adobe Printer), with the correct color settings?

If that prints in color, then just print the Report.
Then just use the PDF for emailing, distribution, ...etc

;-)

JeffCoachman
0
 

Author Comment

by:Supertension
ID: 33539222
I don't think the Crit$ declaration has any effect.  I've just created a simple database from scratch with a single report in it and I now use

Set Application.printer = "Adobe PDF"
DoCmd.OpenReport "Report1", acNormal
 
I still get the same problem.

The code prints an Access report called Report1 to the Adobe PDF printer.  The Adobe PDF printer is set to save the file on my desktop.  The file name is produced automatically - it is either the Report1 caption or, if I've left the caption property blank, the file  name is Report1.pdf.

Printing the report straight to a color printer works OK.
Printing the report to the "Adobe PDF" printer manually (i.e.  not using VBA) works.
I only get the problem when I use VBA to do the printing.

I really need to get it working via VBA as later on in my code I combine several different PDFs from different sources into a single pdf for sending to my customer.  Everything must be in color.  Thankfully, this part of my code works OK.

David

0
 

Accepted Solution

by:
Supertension earned 0 total points
ID: 33539373
Just managed to solve the problem.

I went to the page setup for the report, selected 'Use Specific Printer' and selected 'Adobe PDF'.

I then simplified my VBA to DoCmd.OpenReport "Report1", acNormal and it now prints to a pdf in perfect color.

Many thanks for eveyone's help.

David
AdobeSolved.PNG
0
 
LVL 57
ID: 33541135
<<I went to the page setup for the report, selected 'Use Specific Printer' and selected 'Adobe PDF'.>>
 Agh... I thought they had  changed that by 2003.  In past versions, if you choose "Default printer", you'd end up with the printer settings in windows, not the one's in your report.
 Choosing specific printer forced Access to save the printer settings along with the report.
 Good sleuthing on your part.  Make sure you accept your own comment as answer.
JimD.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Have you ever come up with a need of emailing only few pages of PDF file to one of yourfriend or colleague, instead of whole Adobe file? If yes, then surely you have face problems in doing that! Read this section as I have suggested multiple solutio…
In a previous article published here at Experts Exchange, Signature Image with Transparent Background (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_12380-Signature-Image-with-Transparent-Background.html), I explained how to cre…
We often encounter PDF files that are pure images, that is, they do not have text characters, but instead contain only raster graphics. The most common causes of this are document scanning software and faxing software/services that create image-only…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

803 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