Results 1 to 6 of 6
  1. #1
    msmithtlh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    151

    Creating variable number of related records

    I have 3 tables involved in this situation.
    Individuals with a primary key of individualID. This includes name, address, and other data.
    Classes with a primary key of classID. This includes the class name, credits, dates, etc.
    The third table - instructors has only two fields - classID and individualID. Both fields are in the primary key. The purpose is to be able to link multiple instructors to one class.

    I believe this is correct from the table point of view. I'm stumped on how to handle it on the form where classes are entered. I am guessing I need a subform, but still don't know how to make it work for varying number of instructors. Specific guidance would be greatly appreciated.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I would expect a form bound to the classes table with a subform bound to the junction table (the third table).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    msmithtlh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    151
    Yes, as I said, I expected that I needed a subform. But how do I populate the subform so that a class can have one instructor or three or five? What object type? Do I need a button that says "add another instructor" and what does it do in the background?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    A subform in continuous (or datasheet) view will show however many records there are, and will allow a new record to be added at the bottom. The user would be able to add as many or few as they wanted.
    Last edited by pbaldy; 06-13-2016 at 04:28 PM. Reason: fix grammar goof
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    msmithtlh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    151
    Thank you!

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    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. Replies: 3
    Last Post: 03-22-2014, 04:32 PM
  2. Replies: 10
    Last Post: 10-10-2012, 11:15 PM
  3. Replies: 2
    Last Post: 08-15-2012, 02:21 AM
  4. query won't display records with no related records
    By James Brazill in forum Queries
    Replies: 1
    Last Post: 06-28-2011, 02:10 AM
  5. Replies: 1
    Last Post: 01-31-2009, 10:43 AM

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