Solved

access 2007 print color or black from code

Posted on 2014-09-11
4
321 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now