none
Where's The Code For Sub-Form Synchronization?

    Question

  • Hello:

    I have been doing so much Excel development that I'm a little rusty on Access.  I looked at an Access application I wrote two years ago, and it has the following characteristics:

    (1) It has a primary form with business information
    (2) It has three subforms:  One has a series of reminder dates, another has a stock portfolio, and the third has a list of all business associates
    (3) I set up formal relationships (in the relationship manager) such that the primary key in the main table is also a foreign key in each sub-form table, and they are one to many relationships.

    Access seems to handle all the filtering automatically, so that if I enter a primary table profile record, then put a number of records in each of the three sub-forms, whenever I activate the primary form record, all the sub-form records are properly rendered.  Yet, I can't see how Access is doing that... is it under the covers, because I'm not doing any filtering myself.  I also noticed that Access inserts the foreign key (that points to the primary table) automatically into the three sub-form tables and I don't have to deal with it.

    Regards,


    Rich Locus, Logicwurks, LLC

    http://www.logicwurks.com


    • Edited by RichLocus Wednesday, February 06, 2013 4:30 AM
    Wednesday, February 06, 2013 4:29 AM

Answers

  • It uses the Master/Child links set using the primary/foreign key.

    In design view of the form, click on subform (small square in the upper left corner) and open the Properties - Data tab and look at the 'Link Master Fields' and the 'Link Child Fields'.



    • Edited by KARL DEWEY Wednesday, February 06, 2013 4:38 AM
    • Marked as answer by RichLocus Wednesday, February 06, 2013 4:50 AM
    Wednesday, February 06, 2013 4:36 AM

All replies

  • It uses the Master/Child links set using the primary/foreign key.

    In design view of the form, click on subform (small square in the upper left corner) and open the Properties - Data tab and look at the 'Link Master Fields' and the 'Link Child Fields'.



    • Edited by KARL DEWEY Wednesday, February 06, 2013 4:38 AM
    • Marked as answer by RichLocus Wednesday, February 06, 2013 4:50 AM
    Wednesday, February 06, 2013 4:36 AM
  • Thanks Karl:

    Yes indeed!!  Apparently if the "Link Master and Child Fields" is set, Access takes care of everything.

    Thanks...  It's good to know it isn't just "magic".

    Regards,


    Rich Locus, Logicwurks, LLC

    http://www.logicwurks.com

    Wednesday, February 06, 2013 4:52 AM
  • Apparently if the "Link Master and Child Fields" is set, Access takes care of everything.

    Thanks...  It's good to know it isn't just "magic".

    Any sufficiently advanced technology ...


    Dirk Goldgar, MS Access MVP
    Access tips: www.datagnostics.com/tips.html

    Wednesday, February 06, 2013 2:07 PM