Print Pivot chart form without displaying print button & in colour

MichaelWaimauku

Registered User.
Local time
Tomorrow, 11:33
Joined
Dec 6, 2012
Messages
57
Hi

I have a pivot chart on a form and have put a button on it. The code to make the button invisible on click:

Code:
[Supplier Issues per Month Query].SetFocus
Command1.Visible = False

I want to be able to print the form and with it printing in colour. If I put DoCmd.PrintOut, it prints in b&w only. Any help would be appreciated :)
 
Use Docmd.Print...with the report controls in color.
 
It's not a report that's printing but rather the form that is loaded up. It's a pivot chart that's built into the report and has a print button on the page. I can use a print macro but the botton displays. Is there a way to get DoCmd.PrintOut to default to colour instead of B&W??
 
I did a work around by converting a macro to vba. The solution to print a form with the buttons not showing is:

Code:
Private Sub Command1_Click()
On Error GoTo Command1_Click_Err
  [COLOR=green] 'Sets focus on form[/COLOR]
 [Supplier Issues per Month Query].SetFocus
    [COLOR=green]'Makes buttons invisible so will not show up on printout[/COLOR]
    Command1.Visible = False
    Command3.Visible = False
    [COLOR=green]'Opens print dialog box[/COLOR]
DoCmd.SelectObject acForm, "Supplier Issues Per [COLOR=green]Quarter[/COLOR] Pivot Chart Query: Form", True
    DoCmd.RunCommand acCmdPrint
    DoCmd.SelectObject acForm, Screen.ActiveForm.Name, False
    
[COLOR=green]       'Sets buttons back to being visible once printed else would stay     invisible till form was closed and reopened.[/COLOR]
       Command1.Visible = True
       Command3.Visible = True

Command1_Click_Exit:
    Exit Sub
Command1_Click_Err:
    MsgBox Error$
    Resume Command1_Click_Exit
End Sub
 

Users who are viewing this thread

Back
Top Bottom