Refresh Pivot Table

LadyDi

Registered User.
Local time
Today, 15:42
Joined
Mar 29, 2007
Messages
894
I have a form, containing a button that when clicked, it runs a query and displays the results in Pivot Table view. The query is set to display only results for the manager name selected on the form. So, when someone opens this database, they first select their name from a drop down box and then click the button to run the query. The query displays average call rate for equipment that person is responsible for. The only problem I am having is that if someone goes back to the main form, selects a different name, and clicks the button again, the query will not refresh. The query won't even refresh when I click the Refresh All button in the Ribbon. In order for the query to update, I have to first click the button to refresh the pivot table and then click the button to refresh the query. Is there a way to do these two steps through visual basic, so that the user doesn't have to do those two extra steps?

Right now, I am using the Docmd.OpenQuery code on my button. Is there something that would be better?

Any advice you can provide would be greatly appreciated.
 
are the query results bound to a form, if so just use formName.Requery in the AfterUpdate event of the manager select combobox

David
 
Thank you for the suggestion. Unfortunately, the results are not tied to a form. It's just a query displayed as a pivot table. I tried adding the code TwelveMoHistory.Requery to the On Click event of my button, but I got an error message stating that an object was required.
 

Users who are viewing this thread

Back
Top Bottom