Results 1 to 5 of 5
  1. #1
    stanbridge is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    12

    Question Refreshing Parent Form when new record added via SubForm

    Hi all,

    I have a Parent-form containing two Sub-forms. Each sub-form updates records in their respective table as well as a shared table.

    The two ID fields in each sub-form are linked as "Child fields" to the Parent-form's "Master Fields".

    The Parent form gets it's "Master Field" values from a Query.

    This query is based on the records updated by either of the two subforms.

    After I add a new record via one of the subforms, the Master fields on the Parent form do not update. The only way to get it to update is to close the Parent form altogether and then open it again.

    I think what I need to be doing is adding something to "On Mouse Up" of the button, or even better, the "After Update" on one field in each of the subforms. That said, I have tried several different things, none will do what I want.

    Can anybody show me how to do this?

    Click here to download what I have so far. The forms in question are:
    * DATA_ENTRY_CONTAINER_F (the parent form)
    * Native_Subform_F


    * OtherBird_Subform_F

    Summary: Essentially, this is my way of making the forms automatically assign a new number to each record for my Supertype and Subtype structure (without using autonumbers). Each new record "Fauna_ID" and respective "X_Fauna_ID" should match the Next_Fauna_ID. And it's this Next_Fauna_ID that isn't updating... which at the moment isn't updating the way it should, thus this post.

    Thanks guys. Any help is very much appreciated!!!


    Cheers,

    Stanbridge

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    "After Update" on field in the subform(s) put:
    me.parent.requery

    hope this helps.

  3. #3
    stanbridge is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    12
    Hi NTC,

    Thanks for the reply!

    I tried adding me.parent.requery to the "After Update" event for the "Fauna_ID" field in each subform. Unfortunately, it does not refresh the field displaying in the Parent form (which comes from a query based on the tables updated by the subform).

    Any other ideas?

    Cheers,

    Stanbridge

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    This is a most unusual design by my experience. How do the values increment? I find no code (macro or VBA) in the project that accomplishes this. Not grasping some concept here. Could you clarify?

    Also, why separate species tables? There are multiple tables with the same structure. Why not one table with another field for the species category (Feral, Native, Other, Shearwater)? If you add species, need to keep adding tables. Not correctly normalized data structure.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    in regard to that field not updating; do a sanity check; put in a value in the subform so that the AfterUpdate event fires - - and then manually open that query record source and see what value is there.....might help you get some insight as to what is what.....

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

Similar Threads

  1. Replies: 5
    Last Post: 03-17-2011, 06:21 AM
  2. Replies: 1
    Last Post: 12-22-2010, 01:28 AM
  3. Replies: 2
    Last Post: 10-19-2010, 11:05 AM
  4. Refreshing subform when form refreshed
    By Remster in forum Forms
    Replies: 27
    Last Post: 10-15-2010, 09:39 AM
  5. Replies: 5
    Last Post: 06-29-2010, 01:24 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