467,075 Members | 935 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,075 developers. It's quick & easy.

Print updated pivot chart report (Macro or VBA)

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
  • viewed: 2931
Share:
1 Reply
Expert 256MB
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.

Similar topics

reply views Thread by DAL | last post: by
2 posts views Thread by Saintor | last post: by
3 posts views Thread by GoalieGW | last post: by
2 posts views Thread by KidSlyce | last post: by
1 post views Thread by thomas.wordsworth@gmail.com | last post: by
reply views Thread by tambourine63 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.