Solved

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

Posted on 2010-08-25
9
1,174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 58
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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

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 58
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

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

630 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