By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,335 Members | 2,218 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,335 IT Pros & Developers. It's quick & easy.

Print updated pivot chart report (Macro or VBA)

P: 3
Hi,

Has anyone come across a print report macro that updates any changes you make on a main form?

The issue I have is I have a pivot chart called [frmMIN_PivotChart]

It is a sub form in the main form [frmMain]

I have a cammand button that prints the report [rptMIN]

However when you make changes to [frmMIN_PivotChart] on [frmMain] and hit the command button it does not print the changes.

I made the initial macro to code below, can I do it in a macro or can I alter the code below?

Private Sub cmdPrintMin_Click()
On Error GoTo Err_cmdPrintMin_Click

Dim stDocName As String

stDocName = "rptMIN"
DoCmd.OpenReport stDocName, acNormal

Exit_cmdPrintMin_Click:
Exit Sub

Err_cmdPrintMin_Click:
MsgBox Err.Description
Resume Exit_cmdPrintMin_Click

End Sub
Mar 18 '08 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 374
Hi,

Has anyone come across a print report macro that updates any changes you make on a main form?

The issue I have is I have a pivot chart called [frmMIN_PivotChart]

It is a sub form in the main form [frmMain]

I have a cammand button that prints the report [rptMIN]

However when you make changes to [frmMIN_PivotChart] on [frmMain] and hit the command button it does not print the changes.

I made the initial macro to code below, can I do it in a macro or can I alter the code below?
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdPrintMin_Click()
  2. On Error GoTo Err_cmdPrintMin_Click
  3.  
  4. Dim stDocName As String
  5.  
  6. stDocName = "rptMIN"
  7. DoCmd.OpenReport stDocName, acNormal
  8.  
  9. Exit_cmdPrintMin_Click:
  10. Exit Sub
  11.  
  12. Err_cmdPrintMin_Click:
  13. MsgBox Err.Description
  14. Resume Exit_cmdPrintMin_Click
  15.  
  16. End Sub
  17.  
The reason your changes don't print, you have to be able to make the changes on the pivot table that is in the report. the one on the form is a separate piviot table. If you're wanting to make changes to the piviot table in the Access Report, you'll need to make the changes in code, then after that is completed and rendered, then you can print it out.

If you need a more detailed answer, I would have to have you post the report and the table schema and queries and forms that you have and how you have it setup.

Hope that helps,

Joe P.
Mar 19 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.