Solved

access 2007 print color or black from code

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

867 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

12 Experts available now in Live!

Get 1:1 Help Now