Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jan 2005
    Location
    Wichita, Kansas, USA
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    populating a subform (2000 SR-1)

    I have a "student" table and form with various demographic details and I have a "Parents" table with a subform inside the student form. How do I make it so that I can select one record from the parent table that correlates that student with his/her parent and populates that subform with all of the parent demographic data? They are related by a "StudentID" field. Does that make any sense? (Each record of a parent could have 0-multiple students in the database; each student record would only be linked to one parent record.)

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: populating a subform (2000 SR-1)

    How you do it depends on which way you want to view the data.

    One parent has multiple students. So if you viewed the info from the parent point of view you need to be able to see many students. For this you need a subform with the master and childs fields set to studentID.
    edited by John
    Oops. If each parent can have multiuple children, the link between students and parents is via a parentID not a studentID. The students table will have a parentID field identifiying who their parent is. This field would then be used as the linking field between the form and subform

    ***********
    However, if you view it from a student, there is only one parent to show, so you do not need a subform. Instead make a query that joins students with parents, and build a form on this query. This will enable you to show student and parent info in the one form.
    Regards
    John



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •