Results 1 to 12 of 12
  1. #1
    snowboarder234's Avatar
    snowboarder234 is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    243

    Junction Table

    http://www.box.com/s/34ccaa6d7c85953274f8

    I need to set up a relationship between the student and the funding sources. I think a junction table is the tool for that, but I haven't been successful in setting it up.

    The two tables are:
    tblStudents -- one student can have multiple funding sources. This table already is linked to another table.


    tblFundingSources -- one funding source can have multiple students

    I tried to set up a junction table: tblFundingJunction. However, when I link the junction table to the student table I cannot open the existing subrecords in the student table. Further, it doesn't achieve the many-to-many relationship I was trying to set up.

    I'm sorry I am not able to save this database into a lower version.

    Thanks in advance to anyone who is able to help.

  2. #2
    Join Date
    Apr 2012
    Location
    Los Angeles
    Posts
    75
    You need fields like this in all tables:
    tblStudents should have a StudentID as primary key
    tblFundingSources should have a FundingSourceID primary key
    tblStudentsFunding should have a StudentID and FundingSourceID field as foreign key relationships.
    I am downloading your app now to take a look so I will give you more feedback shortly.

  3. #3
    Join Date
    Apr 2012
    Location
    Los Angeles
    Posts
    75
    You have the right fields set up but you don't have the relationship drawn between the tblStudents and tblFundingJunction. You need to create the relationship.

  4. #4
    snowboarder234's Avatar
    snowboarder234 is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    243

    Response

    Quote Originally Posted by AccessMSSQL View Post
    You have the right fields set up but you don't have the relationship drawn between the tblStudents and tblFundingJunction. You need to create the relationship.
    Thank you for your assistance. However, I took the steps you recommended and now I have another concern. Now, the tblFundingJunction, when linked to the tblStudents, overrides the previous link I had before, which was to the Attachments table.

    To further illustrate: My original linking to the tblStudent was to an Attachment table.

    Click image for larger version. 

Name:	Attachment.jpg 
Views:	10 
Size:	181.4 KB 
ID:	7207

    Now, having linked the tblStudent to the tblFundingJunction, the attachment table is no longer visible as a subdata record.
    Click image for larger version. 

Name:	FundingLink.jpg 
Views:	10 
Size:	173.7 KB 
ID:	7209

    It's good that the funding data displays. However, I need BOTH the attachment table and the funding table to display as subdata records in the tblStudent. Is that possible?
    Attached Thumbnails Attached Thumbnails FundingLink.jpg  

  5. #5
    Join Date
    Apr 2012
    Location
    Los Angeles
    Posts
    75

    Changing the SubDataSheet displayed in a table - Access 2010

    You cannot display both at the same time in your table. You can change what datasheet you want to appear - see attached images:
    Click image for larger version. 

Name:	ChangeSubDataSheet.jpg 
Views:	12 
Size:	75.3 KB 
ID:	7214
    Click image for larger version. 

Name:	ChangeSubDataSheet2.jpg 
Views:	11 
Size:	118.9 KB 
ID:	7215

  6. #6
    snowboarder234's Avatar
    snowboarder234 is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    243

    Thank you

    Quote Originally Posted by AccessMSSQL View Post
    You cannot display both at the same time in your table. You can change what datasheet you want to appear - see attached images:
    Click image for larger version. 

Name:	ChangeSubDataSheet.jpg 
Views:	12 
Size:	75.3 KB 
ID:	7214
    Click image for larger version. 

Name:	ChangeSubDataSheet2.jpg 
Views:	11 
Size:	118.9 KB 
ID:	7215
    The information about the technique for accessing more than one subdata sheet was helpful. Thank you.

    Unfortunately, the junction table is not working and I simply cannot see what I need to do differently. The problem is the funding source is showing up on EVERY entry in the student table when, in reality, only two entries in the student table should be assigned additional funding thus far. In other words, only a few people in the student table will have additional funding. But, one student might have up to 3 or more additional funding sources, while another student, for example, will have none or maybe one.
    Updated database

    Click image for larger version. 

Name:	FundingJunction.jpg 
Views:	14 
Size:	49.0 KB 
ID:	7216

    Thank you again for your assistance.

  7. #7
    Join Date
    Apr 2012
    Location
    Los Angeles
    Posts
    75
    Okay. Let me take a look and see what's going on.

  8. #8
    Join Date
    Apr 2012
    Location
    Los Angeles
    Posts
    75

    Junction Table

    Ahhh..I see the problem here. Your tblFundingSources has student information in it. You need to remove the student information from that table.
    tblFundingSources should only have the funding source information. The tblFundingJunction must be populated with a studentID and a FundingSourceID. See attached modification.

    You might want to add a subform to your main student form that is bound to the tblFundingSources table (just like your attachments subform).
    Attached Files Attached Files

  9. #9
    snowboarder234's Avatar
    snowboarder234 is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    243
    Okay, I removed the student information from the tblFundingSources and populated the tblFundingJunction with only the StudentID and FundingSourceID. I added the tblFundingSources as a subform (or I thought I did), but when I look the main student table (tblStudent) again, ALL students display funding sources, when at this point, there are only two students.

    Is my expectation incorrect in assuming that when, after setting up the junction table the tblStudent subform will selectively reveal ONLY those individuals who are linked to funding sources? Am I trying to do something that's not possible? I had envisioned the same kind of relationship as when I view the tblAttachment that is linked to the tblStudent. Each student is assigned to the correct attachment. Some have attachments at this point, some don't, and the relationship bears that out.

    I will say, when I look at the tblFundingSource, the subform has the correct linkage to the correct student. However, if you look at the resultant frmFundingSource, it's a rather inelegant design. The student who has 3 sources of funding appears in the frmFundingSource as 3 separate records. Again, I was hoping to achieve something that would show 1 student = multiple funding sources. Maybe that's not possible at this point?

    Thank you once again for your help.
    Updated Database

  10. #10
    Join Date
    Apr 2012
    Location
    Los Angeles
    Posts
    75
    You are getting there but I think problem you are having is you are getting tblFundingSources confused with tblFundingJunction. The tblFundingJunction table is the table that needs to be in the subform on your main student form and also appearing in your datasheet. Base your subform on tblFundingJunction. Open the tblStudent table and change the subdatasheet to point to tblFundingJunction - see my earlier screenshot on how to do this. I re-posted your project in my last post and it has all of the changes I recommended. Here are some screenshots of how it should be set up. Click image for larger version. 

Name:	FundingJunctionRelationships.jpg 
Views:	13 
Size:	66.5 KB 
ID:	7221
    Here is the student table with subdatasheet shown:
    Click image for larger version. 

Name:	StudentTablewithSubDataSheet.jpg 
Views:	10 
Size:	77.2 KB 
ID:	7222

    I hope this helps!

  11. #11
    QIZHIQIANG is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2012
    Posts
    2

  12. #12
    snowboarder234's Avatar
    snowboarder234 is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    243
    Quote Originally Posted by AccessMSSQL View Post
    You are getting there but I think problem you are having is you are getting tblFundingSources confused with tblFundingJunction. The tblFundingJunction table is the table that needs to be in the subform on your main student form and also appearing in your datasheet. Base your subform on tblFundingJunction. Open the tblStudent table and change the subdatasheet to point to tblFundingJunction - see my earlier screenshot on how to do this. I re-posted your project in my last post and it has all of the changes I recommended. Here are some screenshots of how it should be set up. Click image for larger version. 

Name:	FundingJunctionRelationships.jpg 
Views:	13 
Size:	66.5 KB 
ID:	7221
    Here is the student table with subdatasheet shown:
    Click image for larger version. 

Name:	StudentTablewithSubDataSheet.jpg 
Views:	10 
Size:	77.2 KB 
ID:	7222

    I hope this helps!
    Wow -- I would have never been able to do this without your help. Thanks so much. Those junction tables are really tricky. It's working now exactly as I had envisioned. Next challenge will be doing the same thing for individuals who have published articles and books. I'm stoked to start that after all the funding data is entered.

    Thank you, thank you, thank you.

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

Similar Threads

  1. populating junction table problem
    By SansPeur in forum Forms
    Replies: 6
    Last Post: 02-10-2012, 08:31 AM
  2. Replies: 1
    Last Post: 01-23-2012, 08:43 AM
  3. How to use Junction Table to populate DB
    By Sorbz62 in forum Forms
    Replies: 1
    Last Post: 10-02-2011, 05:45 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