Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

access 2007 print color or black from code

Posted on 2014-09-11
4
Medium Priority
?
334 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
[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
  • 2
  • 2
4 Comments
 
LVL 85
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 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 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

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

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.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

722 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