It's weird, if I open my subform separately, the PivotChart reflects the constrained data. However within the main form, it seems to refresh with cached data
It's weird, if I open my subform separately, the PivotChart reflects the constrained data. However within the main form, it seems to refresh with cached data
Sorry about the CurrentDb part. I don't know where my head was.
As for the refresh of the data, what is the actual name of the subform control that houses the pivot chart on the form? So, let's say it is Child2 and the form inside of it is Form6 your code would need to be
Me.Child2.Form.Requery
No worries! I'm grateful you got me so far.
The subform that houses the PivotChart is "Form6". My code is below:
Me.Form6.Form.Requery
Unfortunately it is still not working. I did try opening another instance of the Form6 within the code and that PivotChart displayed with the constrained data. Not really sure what is going on
Just making sure that we are talking about the same thing here. Take a look at the screenshot on this page
http://www.btabdevelopment.com/ts/ewtrhtrts
and see if what it says CONTAINER is what we are talking about.
yes the subform is called 'Form6'. i am sure of this because I have a separate main form that just takes the constraint from a comboBox using the same subform, and that requeries using the same code:
Me.Form6.Requery (which I also tried with the List Box form and didn't work either)
Okay, so we might have to do another approach. After the query's criteria has been updated we can set the application Echo to false so it doesn't look like we're doing anything to the user but then we set the subform control's source object to something else and then set it back to the original item. So, something like this:
Code:Application.Echo False Me.Form6.SourceObject = "" Me.Form6.SourceObject = "NameOfFormHere" Application.Echo True
THANK YOU!!!!! That did the trick. I'm puzzled as to why we have to reset the SourceObject, shouldn't the command to requery force the form to rerun the query? But not going to dwell on it, it works and that's all that matters. Thank you for much for wasting so much time on this with me.
Ed