Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1213
  • Last Modified:

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


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
Supertension
Asked:
Supertension
  • 3
  • 3
  • 2
  • +1
1 Solution
 
tbsgadiCommented:
Have a look at http:Q_20878116.html

Gary
0
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
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
 
Jeffrey CoachmanCommented:
<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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
SupertensionAuthor Commented:
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
 
Jeffrey CoachmanCommented:
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
 
Jeffrey CoachmanCommented:
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
 
SupertensionAuthor Commented:
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
 
SupertensionAuthor Commented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
<<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

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now