Results 1 to 8 of 8
  1. #1
    Palladian is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Posts
    6

    Updating junction table in form

    Hi,

    I have an access database that contains three tables: Person, Scholarship, and PersonToScholarship (a junction tables that handles the many-to-many relationship between people and scholarships. It includes three fields: autoID, PersonID, and ScholarshipID).

    I have a form that displays each person's information, including a subform that displays their scholarships (using a query that joins Person, PersonToScholarship, and Scholarship on Person.ID to PersonToScholarship.PersonID and Scholarship.ID to PersonToScholarship.ScholarshipID). The problem is that you can't use this subform to add or delete scholarships from a person's form page. The subform currently contains just one field, ScholarshipName, and if you change that name, you aren't changing the scholarship that the person is affiliated with, you are changing the scholarship's name.

    What I need is a way to use this form to add and delete scholarships relationships without having to manually insert them into the PersonToScholarship table. Maybe with combo boxes...?



    Any help is greatly appreciated. Thanks!
    Attached Files Attached Files
    Last edited by Palladian; 11-13-2012 at 04:33 PM.

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    What I need is a way to use this form to add and delete scholarships relationships without having to manually insert them into the PersonToScholarship table. Maybe with combo boxes...?
    You are correct.

    In my subforms, the subform is in continuous forms, with a combo box to change the (in your case) scholarship - which actually should change the ScholarshipID (in the junction table). The ScholarshipID field should not be visible (field width = 0), the scholarship name visible (using the combo box).

  3. #3
    Palladian is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Posts
    6
    So how do I go about using combo boxes? Because a person can have multiple scholarships, do I write some sort of macro (I have no experience with those) to generate the number of combo boxes that I need?

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    When you add a new record in the subform, you set it up to automatically enter the personID and the ScholarshipID is selected by the combo box.
    The subform allows you to have as many records in the subform as you want/need. The records source for the subform would be a query on the junction table.

  5. #5
    Palladian is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Posts
    6
    Sounds good--I'm new to Access, though, and I'm still confused as to how to go about doing this. I've attached my database to my original post--would you mind showing me how to do this?

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Won't be able to look at it until tonight....

  7. #7
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Something like this??

  8. #8
    Palladian is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Posts
    6
    This is great! Thank you so much!

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

Similar Threads

  1. Junction Table
    By snowboarder234 in forum Access
    Replies: 11
    Last Post: 04-18-2012, 09:31 AM
  2. How to use Junction Table to populate DB
    By Sorbz62 in forum Forms
    Replies: 1
    Last Post: 10-02-2011, 05:45 PM
  3. Populating Junction table from form
    By JFo in forum Access
    Replies: 18
    Last Post: 09-05-2011, 09:15 PM
  4. Updating a Junction Table
    By oleBucky in forum Forms
    Replies: 4
    Last Post: 04-05-2011, 04:59 PM
  5. Junction Table
    By mae3n in forum Database Design
    Replies: 2
    Last Post: 01-15-2011, 10:23 PM

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