Refresh a subform within a subform within a Form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bplantes
    New Member
    • Feb 2008
    • 17

    Refresh a subform within a subform within a Form

    I have a "Dashboard" in a tool I am building which has a list of different buttons. Clicking on each button will display different subforms which show up in a window to the right of the menu.

    One of these "Screens" has a subform which needs to be refreshed after updating one of the other "Screens." The problem is, the screens do not refresh when switching between screens with the menu buttons.

    Is there a way to have the subform within the subform within my Dashboard to refresh with a button pressed on my Dashboard?

    I have attached a screenshot of my Dashboard....

    Thanks.
    Attached Files
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32662

    #2
    You may find Referring to Items on a Sub-Form helpful :)

    You will need to call a ReQuery of the relevant subform.

    Comment

    • bplantes
      New Member
      • Feb 2008
      • 17

      #3
      I have tried using the External Syntax as described in your thread. After updating a combobox on one of the SubForms (Form1 for example) within my dashboard I need it to update the subform within Form1... to do this I have the following code:

      Code:
      Dim strQuery As String
      
      strQuery = "SELECT * FROM TableName WHERE Criteria = " & combobox_Value
      
      Forms!Dashboard.Form1.subfrmWithinForm1.RecordSource = strQuery
      
      Forms!Dashboard.Form1.subfrmWithinForm1.Requery
      I get the following error at the .RecordSource Line:

      "Object Doesn't Support This Property or Method"

      I have assigned a RecordSource to a SubForm Before, so I am not sure of the problem. Any suggestions?

      Thanks for the help.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32662

        #4
        At a quick glance (all I have time for at the moment) I would guess that you are calling a ReQuery on the subform control on your form rather than the form that is in it.

        This is covered in the HowTo so have another look. If you're still not able to get it to work then post back but include all the relevant details (names etc) of the items and I'll see what I can manage for you.

        Comment

        • bplantes
          New Member
          • Feb 2008
          • 17

          #5
          I figured it out. I just used the "Me!subform " reference and it worked. I think I was trying to make the code more complicated than it needed to be. Thanks for the help.

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32662

            #6
            Easily done in complicated areas, and this is certainly one of those. Congratulations for finding the solution. Even better that it's a simple and neat solution :)

            Comment

            Working...