Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    klg is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    13

    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

  2. #17
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by klg View Post
    I was able to resolve the error by using CurrentDb instead of CurrentDatabase. However I can't seem to get my subform to refresh using the edited query with the new Where clause.
    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

  3. #18
    klg is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    13
    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

  4. #19
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    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.

  5. #20
    klg is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    13
    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)

  6. #21
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    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

  7. #22
    klg is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    13
    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

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Retrieving values from a Combo Box
    By dreamnauta in forum Programming
    Replies: 3
    Last Post: 01-16-2012, 10:18 AM
  2. Retrieving PDF's Efficiently
    By tcheck in forum Access
    Replies: 3
    Last Post: 08-05-2011, 07:30 AM
  3. Replies: 3
    Last Post: 07-18-2011, 04:14 PM
  4. Retrieving data on my website
    By kattys in forum Access
    Replies: 1
    Last Post: 04-27-2010, 05:02 PM
  5. SQL- retrieving info
    By jmarti57 in forum Programming
    Replies: 0
    Last Post: 12-10-2008, 03:05 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums