?
Solved

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

Posted on 2010-08-25
9
Medium Priority
?
1,195 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

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

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

718 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