Results 1 to 5 of 5
  1. #1
    rcv is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    May 2012
    Posts
    3

    Question Link table in n<->n relationship: Subform is empty (no controls) so I can't add data.


    Using Access 2010, I have two tables (Students and Classes) in a many-to-many relationship linked through a "tlnk_student-class" table. I have created a main form that is used to look up the student, which is linked to a subform that shows the classes to which the student is registered. I want to be able to add students and classes in which the student is enrolled on the form (and subform). I have a query (qlkp_student_sort) that sorts tbl_student and populates the main form. This main form allows me to view and add students to the main form. (So far, so good.) I have also created a query qlnk_student-classes that uses tlnk_student_class and tbl_classes to get the class data and sort it by student_id. If a student has classes in tbl_class, the class appears on the form, but I can't add new classes AND if the student does not yet have any classes in tbl_class, the form is blank - no controls appear so I can't add classes by using the form. What have I missed? Any help would be appreciated. rcv.

  2. #2
    rcv is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    May 2012
    Posts
    3
    Also, the "Allow Additions" Property is set to "Yes" on both the Main Form and the Sub-form.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    What is the difference between Registered and Enrolled? Where does "tlnk_student-class" fit?

    I responded to a post concerning m:m relationship recently - it may be helpful to you.
    see https://www.accessforums.net/forms/c...tml#post132322

  4. #4
    rcv is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    May 2012
    Posts
    3
    Registered = enrolled. Sorry that I wrote that badly. One student can be enrolled in many classes, and one class can have many students, so tlnk_student-class has (as foreign keys) the primary keys of both tables as a record.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,919
    Are the RecordSources direct to tables or are they queries? If queries, could be issue with jointype if multiple tables in the query.

    Want to provide db for analysis? Follow instructions at bottom of my post.
    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.

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

Similar Threads

  1. Replies: 1
    Last Post: 04-18-2012, 11:06 AM
  2. Replies: 2
    Last Post: 08-01-2011, 11:35 PM
  3. Change controls on an empty form
    By Dom in forum Forms
    Replies: 2
    Last Post: 01-19-2011, 08:36 AM
  4. Replies: 1
    Last Post: 06-14-2010, 03:01 PM
  5. Controls go blank on empty query result
    By kevdfisch in forum Programming
    Replies: 4
    Last Post: 08-25-2009, 08:07 AM

Tags for this Thread

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