Solved

access 2007 print color or black from code

Posted on 2014-09-11
4
330 Views
Last Modified: 2014-10-28
If Previewing Then                  'RpQtr-Title page140331
                    DoCmd.Close acForm, "fm_ReportPrinter"
                    DoCmd.OpenReport TitleReportName, acViewReport, , "HHID = " & ClientNowPrinting              
                    'MsgBox "Preview complete?"
                Else
                    DoCmd.OpenReport TitleReportName, acViewPreview, , "HHID = " & ClientNowPrinting
                    DoCmd.RunCommand acCmdPreviewFourPages
                End If
               
                If PauseBeforeClosingSection Then MsgBox ("Proceed")
               
                If Not ViewOnly Then
                    DoCmd.PrintOut acPages, 2, 2
                End If
                Debug.Print "Title Page"
               
                If Not Previewing Then DoCmd.Close acReport, TitleReportName
               
                If CancelBeforeNextSection Then
                    answer = MsgBox("Printed Title Page." & vbCrLf & "Next Section: Title Page for 2ndary HH", vbOKCancel)
                    If answer = vbCancel Then
                        Debug.Print "-------  List Aborted  -------"
                        Exit Do
                    End If
                End If



               

printer is Konica-Minolta bizhub C360

The printer is set to black & white default.
This code correctly produces color reports.

How do I get it to print black & white (for rough review copies)?
0
Comment
Question by:David_W_R
  • 2
  • 2
4 Comments
 
LVL 84
ID: 40317492
In the report Page Setup, have you specified the printer, and specified that you want color print? The code you've shown here is pretty basic - it just opens the report in a specific mode.

You could use the Printer object of the Printers collection. The printer object can be used to set the properties you want, then you print the report, then reset. For example:

Dim prtDefault As Printer
Dim prtNew as Printer

Set prtDefault = Application.Printer
Set prtNew = Application.Printers("Name of your printer")

prtNew.ColorMode = acPRCMMonochrome
prtNew.Copies = 2
prtNew.Duplex = acPRDPSimplex

Application.Printer = prtNew

<print your report here>
'/ reset to the Default printer
Application.Printer = prtDefault

Open in new window


Note that in order to use this code, your report will have to be set to use the Default Printer:

Default Printer
0
 

Author Comment

by:David_W_R
ID: 40317689
My Windows XP sp3 does not have the "Page" tab with the "Default Printer" option as you show above.  On the Print window, selecting the "Setup,.." button gives me a window with only "Print Options" tab (Margins, Print Data Only, Split Form options) and "Columns" tab.  How do I set XP to Default Printer?  

From the Print menu, I can only select the default printer itself from those listed, but have nowhere that I can see to designate "Default Printer".
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40317843
You do this in design view of the report, under the Page Setup option. From what I can tell, you're using 2007. If so, then you should see tabs similar to what I'm showing on my image. If not, take a screenshot of the report in design view, and post it back here.

How do I set XP to Default Printer
To be clear: this has nothing to do with the Operating System. I'm running Windows 7, but Access 2013 shows the same tabs regardless of the OS - just as does Access 2007 and 2010.
0
 

Author Comment

by:David_W_R
ID: 40318059
Found it.  It was already set to Default Printer.

Still printing color.  Probably another subtle error on my part.   Code looks like this:

Dim prtDefault As Printer
Dim prtNew As Printer
'
Set prtDefault = Application.Printer("KONICA MINOLTA C360SeriesPS")
Set prtNew = Application.Printers("KONICA MINOLTA C360SeriesPS")
'
prtNew.ColorMode = acPRCMMonochrome
'prtNew.Copies = 2
'prtNew.Duplex = acPRDPSimplex
'
Application.Printer = prtNew
'
               
        If PrintTitlePage Then
           
                                                'Print      Title page
           
'            If (IsNull(!SharesAccountWithHh) Or !SharesAccountWithHh = 0) And IncludeUnshared Then
                     
                If Previewing Then                  'RpQtr-Title page140331
                    Previewing = True
                    DoCmd.Close acForm, "fm_ReportPrinter"
                    DoCmd.OpenReport TitleReportName, acViewReport, , "HHID = " & ClientNowPrinting               'v CHANGE to Report Quarter
                    'MsgBox "Preview complete?"
                Else
                    DoCmd.OpenReport TitleReportName, acViewPreview, , "HHID = " & ClientNowPrinting         ' modify with your statement
                    DoCmd.RunCommand acCmdPreviewFourPages
                End If
               
                If PauseBeforeClosingSection Then MsgBox ("Proceed")
               
                If Not ViewOnly Then
                    DoCmd.PrintOut acPages, 2, 2
                End If
                Debug.Print "Title Page"
               
                If Not Previewing Then DoCmd.Close acReport, TitleReportName
               
                If CancelBeforeNextSection Then
                    answer = MsgBox("Printed Title Page." & vbCrLf & "Next Section: Title Page for 2ndary HH", vbOKCancel)
                    If answer = vbCancel Then
                        Debug.Print "-------  List Aborted  -------"
                        Exit Do
                    End If
                End If
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

735 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