Results 1 to 11 of 11
  1. #1
    Roadbeer is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    19

    Main Form / Children Refreshing/Requery question


    Hey Folks, new to the board. Been searching for the answer to this for a couple days and trying MANY variations. Access Novice so be kind. (Macros and VBA even more so)

    I have my main form load and all the info in the children loads correct, what I want to do is when I input the data in to "child 1" and press submit, I'd like to have the other children refresh/requery.

    Appreciate any thoughts, I'm licking windows here.

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Does this not work in the submit button (VBA code):

    Forms!MainFormName!SubformControlName.Form.Requery

    VBA goes here if you need it:

    http://www.baldyweb.com/FirstVBA.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Roadbeer is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    19
    It might, where I'm loosing you is in the SubformControlName

    I missed a step in my explanation of what I'm trying to do.
    When I press the submit button on Child 1 It adds data to a table. (previously using a macro for add record)
    Information in Child 2 and 3 is pulled from separate queries based off of that table.
    When I press the submit button, I would like the information that comes from the queries to be reloaded on the form.

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Presuming what you're calling Child is a subform, then in my code SubformControlName would be the name of the subform control on the main form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Roadbeer is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    19
    Correct, it is a subform.

    When I put the code in the submit button on the first subform(named MemberContrubitions) like this, Forms!MemberCard!MemberData.Form.Requery, nothing changes in the MemberData subform.

    Checked spelling just to be sure.

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    And the data input in the first subform would affect the data in the second? Can you post the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Roadbeer is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    19
    Id love to, but getting permission to would be a whole big 'thing'. DB structure breaks down like this

    Junction table - member data
    contribution table - (table i'm working with)
    Main form - (pulls query of member data from junction table. Name, address, etc.)
    Subform 1- (where I input contributions)
    Subform 2- (provides data on member contributions, from query of contribution table displaying indivudal member's contributions)
    Subform 3- (provides data on overall contributions, from query of contribution table displaying overall contributions from all members)

    When I put data into Subform 1, I need subforms 2 & 3 to update.

  8. #8
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I guess you can try without the "Form" part, though I don't think it will matter. This is out of a db I happen to have open where the form has 3 subforms:

    Forms!frmDragging.frmCarsInZone.Requery
    Forms!frmDragging.frmDispNotLoaded.Requery
    Forms!frmDragging.frmTimeOnBreak.Requery

    and it works flawlessly.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    Roadbeer is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    19
    Trying both methods, and even temporarily removing the other subforms just so I could get one of them to refresh, failed to work.

  10. #10
    Roadbeer is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    19
    Figured it out. Was putting the code in the 'submit' button and not in after update.

    Thanks for your help pbaldy! Your help to others has been invaluable to me in putting this DB together

  11. #11
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Glad you got it sorted out.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Requery subform after update of main form
    By gemadan96 in forum Forms
    Replies: 3
    Last Post: 10-17-2012, 02:33 PM
  2. after DAO update, listbox.requery not refreshing
    By EuniceH in forum Programming
    Replies: 2
    Last Post: 10-21-2011, 04:16 PM
  3. Replies: 3
    Last Post: 10-10-2011, 06:33 PM
  4. Refreshing/Requery bounded textboxes
    By jasonbarnes in forum Forms
    Replies: 4
    Last Post: 03-02-2011, 12:09 PM
  5. Replies: 6
    Last Post: 01-13-2010, 02:41 PM

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