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

    Parent/Child relationships (or, whose your daddy?) (2000-SR1)

    With two tables related with a one-to-many relationship, to set up a form and sub-form based on these tables...as a general rule (or maybe an absolute rule), should the "One" be set as the parent, and the table with the "Many" be set as the child, or does it matter?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Parent/Child relationships (or, whose your daddy?) (2000-SR1)

    The "usual" way is to create a main form based on the "one" side table, and a continuous (or datasheet) subform based on the "many" side table. The advantage is that Access will automatically fill in the link field(s) in the subform. If you do it the other way round, the user could fill in an entire record on the "many" side, only to discover that it cannot be saved because there is no parent record on the "many" side.

    An alternative would be to create two separate forms. The "many" form could contain a combo box to let the user select a parent from the "one" side.

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

    Re: Parent/Child relationships (or, whose your dad

    Thanks, Hans. (And boy, am I embarrassed to see that I said, "Whose" your daddy, rather than "Who's"!)

    Warren

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

    Re: Parent/Child relationships (or, whose your dad

    Pursuant to the above, I have the form/subform set up and working as it should (automatically filling in the link fields correctly, etc.). This database though is maybe a little out of the ordinary as it deals with students (literally, the child side) and their families (the parent side!). It is really student-based, but there may be more than one student belonging to a particular family. This is primarily being used for planning, ordering, etc. for a once-a-year graduation ceremony. What I would like to setup for the data entry form (which basically happens once a year), is a way to quickly search to see if the new student already has his/her family already present, then add the new record linked to that family. (Is there a way to set up the

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Parent/Child relationships (or, whose your dad

    One way would be put a search combo box on the main form. The easiest way to create one is to turn on control wizards (this is controlled by the second button on the Control Toolbox, the one with the magic wand), and then place a combo box on the form. Select the 3rd option, then click Next and follow the instructions.

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

    Re: Parent/Child relationships (or, whose your dad

    How could I get it then to display that record in the "frmParentInfo" form (which has the "frmStudentInfo" subform), so that I can edit that record?

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Parent/Child relationships (or, whose your dad

    The combo box wizard will write the code needed for you.

Posting Permissions

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