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

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

access 2007 print color or black from code

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
David_W_R
Asked:
David_W_R
  • 2
  • 2
1 Solution
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
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
 
David_W_RAuthor Commented:
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
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
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
 
David_W_RAuthor Commented:
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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