Link to home
Start Free TrialLog in
Avatar of nzbeaston
nzbeaston

asked on

Pivot table and Chart fails to refresh in Microsoft Access 2003 form

How do I refresh a access pivot chart and pivot table on the same form by vba?
I have an access 2003 form which contains a series of combo boxes allowing a user to filter the data they would like viewed in a graph and pivot table for analysis.  I have tried a requery command through vba to have the chart and table refresh, it fails to do so. Can someone give me a hand with this.
Avatar of puppydogbuddy
puppydogbuddy

Whether the requery works or not often depends on the timing (event) and the object reference used for the object that the requery method is executed for. Also, assumed that the pivot table and chart are just on a form, and not on a subform, correct?  You did not post your code, so it is difficult for any expert to help you. .
Avatar of nzbeaston

ASKER

Thanks for the feedback. Sorry about the delay I have been away.

I've managed to correct the problem which was a piece of code looking at the wrong control.  I had a unbound combo box called "Contractor", the pivot table embedded in the form was looking at the Contractor ID as the Link child and parent fields. As the whole form had an underlying record source of a Contractor Table - the pivot would only update when I moved to the next record. I was attempting to move to the next record through the unbound control which is what I wanted. Once I updated the link child and parent fields to the unbound control and used the requery command the pivot chart and table would refresh. Thanks for your opinion and I will post better code next time.
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial