Adobe 7 Professional prints color reports in black and white

Posted on 2006-06-05
Last Modified: 2012-06-21
This is really odd, but when I automatically print to Adobe pdf my color reports change to black and white. This does not happen with any other driver like pdffactory, but I ma now running into an issue with a logo that prints poorly in pdffactory, but great in Adobe, however it converts the whole report to black and white.

Any ideas? Anyone else seen this weird problem?

Question by:gaynes
    LVL 3

    Expert Comment

    Perhaps you default seting of adobe is in black and white?????
    Just guessing

    Good luck!

    Author Comment

    no, it is standard

    Author Comment

    Thanks to fabulous ACG Soft for the answer

    Yes, we've seen it before, its related to an element of the prtDevMode property that is stored with the report in your database.   Cut and paste the code below into a module in your application.  Run the SetRptColor function from the immediate window specifying the report you are targeting and that should solve the problem.


    Software Tools Group
    ACG Soft


    Option Compare Database
    Option Explicit

    Private Type DEV_MODE_NARROW
        dmDeviceName As String * 16
        dmSpecVersion As Integer
        dmDriverVersion As Integer
        dmSize As Integer
        dmDriverExtra As Integer
        dmFields As Long
        dmOrientation As Integer
        dmPaperSize As Integer
        dmPaperLength As Integer
        dmPaperWidth As Integer
        dmScale As Integer
        dmCopies As Integer
        dmDefaultSource As Integer
        dmPrintQuality As Integer
        dmColor As Integer
        dmDuplex As Integer
        dmYResolution As Integer
        dmTTOption As Integer
        dmCollate As Integer
        dmFormName As String * 16
        dmLogPixels As Long
        dmBitsPerPel As Long
        dmPelsWidth As Long
        dmPelsHeight As Long
        dmDisplayFlags As Long
        dmDisplayFrequency As Long
    End Type
        RGB As String * 6144
    End Type
        RGB As String * 94
    End Type

    Function SetRptColor(strRptName As String, Optional bColorMode As Byte = 2) As Long
    'Purpose:  Sets a report's color settings
    'Accepts:  strRptName: Name of a Report to Set
    '          bColorMode: 1 = monochrome, 2 = Color
    On Error GoTo Err_SPP
    Dim dwOK As Long, lngOrigFields&, lngDMLen As Long
    Dim strRptDevMode As String
    Dim dmAnsiStructOnlyStr As DEV_MODE_STRING_NARROW
    Dim boolFormUse As Boolean
    Dim objFrm As Form
    Const DM_COLOR = &H800

    boolFormUse = False
    Set objFrm = Screen.ActiveForm
    boolFormUse = True
    'Open report get its base settings
    DoCmd.Echo False
    DoCmd.OpenReport strRptName, acDesign
    Reports(strRptName).Painting = False
    DoCmd.ShowToolbar "Report Design", acToolbarNo
    DoCmd.ShowToolbar "ToolBox", acToolbarNo
    DoCmd.ShowToolbar "Formatting (Form/Report)", acToolbarNo
    DoCmd.SetWarnings False
    'Refocus on the form if in use
    If boolFormUse = True Then
        DoCmd.SelectObject acForm, objFrm.Name
    End If
    Application.Echo True
    'Add the settings desired
    If Not IsNull(Reports(strRptName).PrtDevMode) Then
        'set the byte array into the struct
        udtDMstr.RGB = Reports(strRptName).PrtDevMode
        LSet udtDM = udtDMstr
        lngDMLen = udtDM.dmSize + udtDM.dmDriverExtra
        lngOrigFields = udtDM.dmFields
        If Not IsMissing(bColorMode) Then
            udtDM.dmFields = lngOrigFields Or DM_COLOR
            udtDM.dmColor = bColorMode
        End If
        LSet dmAnsiStructOnlyStr = udtDM
        Mid(udtDMstr.RGB, 1, 54) = dmAnsiStructOnlyStr.RGB
        strRptDevMode = left(udtDMstr.RGB, lngDMLen)
        Reports(strRptName).PrtDevMode = strRptDevMode
    End If

    On Error Resume Next
    Application.Echo False
    Reports(strRptName).Painting = True
    DoCmd.Close acReport, strRptName
    DoCmd.ShowToolbar "Report Design", acToolbarWhereApprop
    DoCmd.ShowToolbar "ToolBox", acToolbarWhereApprop
    DoCmd.ShowToolbar "Formatting (Form/Report)", acToolbarWhereApprop
    DoCmd.SetWarnings True
    Application.Echo True
    SetRptColor = True
        Exit Function
    Select Case Err.Number
    Case 2103, 2451
        SetRptColor = False
        Application.Echo True
        MsgBox "Error: The report: """ & strRptName & """, is no longer valid, or the report is missing from this application.", vbCritical, "Report SetUp"
        Resume Exit_SPP
    Case 2475  'No form is active
        Resume NoForm
    Case 2601
        Application.Echo True
        SetRptColor = False
        MsgBox "Error: You don't have the proper permissions for """ & strRptName & """ to allow the application to make proper settings.", vbCritical, "Report Set Up"
        Resume Exit_SPP
    Case 2094 'Toolbar not found
        Resume Next
    Case Else
        Application.Echo True
        MsgBox "Error: " & Err & " " & Error$, , "Report Set Up"
        SetRptColor = False
        Resume CloseRpt
    End Select
    End Function

    Author Comment

    Please close this question. I added the answer. Thanks!
    LVL 58

    Expert Comment

    Hello gaynes,

    See help on "I answered my question myself. What do I do?" http:/help.jsp#hi70
    You basically post a request in http:/Community_Support/ with

        I answered my own question

        Please PAQ and refund http:/Q_21874942.html#16837979


    Accepted Solution

    PAQed with points refunded (125)

    Community Support Moderator

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    This article is a continuation or rather an extension from Cascading Combos ( and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
    I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
    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, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

    794 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

    15 Experts available now in Live!

    Get 1:1 Help Now