Many to Many Relationship Adding Records

pademo57

Registered User.
Local time
Today, 16:28
Joined
Feb 22, 2013
Messages
26
Hi There,
I'm trying to add a record(s) in a join table but I'm not sure what is the best way to do this. Here are my tables:

tblStudents
StudID (pk)
txtFname
txtLname
etc

tblClasses
ClassID (pk)
txtClassName
txtClassCode
etc

tblStud_Class
StudClassID (pk)
fk_StudID
fk_ClassID

I would like to have a Class form and then add the students to it. Is it possible to do this on one form (with the students in a subform maybe)?

Or do I need to setup the Class on a form then move to another form to add the students?

Lastly how do I add the foreign keys (fk) to the join table?

I'm sure this may have been answered many times before but I can't find it when I look it up as, "Many to Many Relationship Adding Records".
 
I'm sure this may have been answered many times before but I can't find it when I look it up as, "Many to Many Relationship Adding Records".

I will give you an example based on an application I developed. For said application, between the Products and Parts table is a ProductPartLink table, as many Products could all share from the same Parts list. The ProductPartLink record not only captured the ProductID and PartID, but also the QytPer and EAU values since that was custom based on the Product <---> Part association.

It sounds more like you are having challenges to get Access bound forms to be able to display such automagically. For my application I use all unbound forms and run SQL to download records into FE temp tables. Thus one SQL may join several tables, download records into a single FE temp table, which makes binding Multiple Record Forms to the table much easier. (Multiple Item forms ARE bound forms, they are just read-only and a SQL takes care of gathering up the fields from the various tables the actually reside in and combining all of those fields into one table. Record INSERT / UPDATE forms are unbound forms.)

Perhaps helpful to you as you ponder directions:

Client/Server Architecture
http://www.access-programmers.co.uk/forums/showpost.php?p=1110794&postcount=5
 

Users who are viewing this thread

Back
Top Bottom