Control print function in a pivot table

J

JOM

I have a print function on a form and the sub form is a pivot table, I am
trying to only print information that I have filtered in the pivot table, but
its printing all the information in the pivot table. Please help

The following is my print function.

Private Sub Command3_Click()
On Error GoTo Err_Command3_Click

Dim stDocName As String
Dim MyForm As Form

stDocName = "Employee Infor pivot table"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.Name, False

Exit_Command3_Click:
Exit Sub

Err_Command3_Click:
MsgBox Err.Description
Resume Exit_Command3_Click

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top