T
Tom
I recently posted a question about multipe M:M relationship tables.
In one reply, RPW responded with the following:
*************
Although the following is an unlikely table construct, it helps for illustrative purposes.
Imagine three tables; tblNames, tblCity, tblAddress. The I want to use 'junction table' called tblNCA. This last table might have the following fields:
tblNCA
ncaID (PK); autonumber
NameID (FK); long integer
CityID (FK); long integer
AddressID (FK); long integer
With these fields, the table functions very well - there is a unique primary key and the foreign keys link the information from the other tables to the NCA table.
Let's assume that we did not want a single field PK and we are going to combine the (FK) fields into a 'composite PK'. The resultant table might look like this:
tblNCA
NameID (FK) (These 3...
CityID (FK) ...fields combine to make ...
AddressID (FK) ...the 'composite' PK)
This table could also function very well.
I sorta figured that with your line of thinking, you would set up the table this way:
tblNCA
ncaID (Having all...
NameID (FK) ...four of these fields...
CityID (FK) ...combined into a...
AddressID (FK) ...single 'composite PK')
*************
Okay, I now have a follow-up question. I need to splice in a 1:M relationship between tblNCA and a subordinate table (let's call it tblSubordinate).
Before creating the composite key of "ncaID, NameID, CityID, AddressID" I only used ncaID (autonumber) to tblSubordinate.SubID (long integer).
Again, now since having created the composite key, I cannot join tblSubordinate into a 1:M relationship from tblNCA to tblSubordinate.
Any suggestions how to do that?
Thanks,
Tom
In one reply, RPW responded with the following:
*************
Although the following is an unlikely table construct, it helps for illustrative purposes.
Imagine three tables; tblNames, tblCity, tblAddress. The I want to use 'junction table' called tblNCA. This last table might have the following fields:
tblNCA
ncaID (PK); autonumber
NameID (FK); long integer
CityID (FK); long integer
AddressID (FK); long integer
With these fields, the table functions very well - there is a unique primary key and the foreign keys link the information from the other tables to the NCA table.
Let's assume that we did not want a single field PK and we are going to combine the (FK) fields into a 'composite PK'. The resultant table might look like this:
tblNCA
NameID (FK) (These 3...
CityID (FK) ...fields combine to make ...
AddressID (FK) ...the 'composite' PK)
This table could also function very well.
I sorta figured that with your line of thinking, you would set up the table this way:
tblNCA
ncaID (Having all...
NameID (FK) ...four of these fields...
CityID (FK) ...combined into a...
AddressID (FK) ...single 'composite PK')
*************
Okay, I now have a follow-up question. I need to splice in a 1:M relationship between tblNCA and a subordinate table (let's call it tblSubordinate).
Before creating the composite key of "ncaID, NameID, CityID, AddressID" I only used ncaID (autonumber) to tblSubordinate.SubID (long integer).
Again, now since having created the composite key, I cannot join tblSubordinate into a 1:M relationship from tblNCA to tblSubordinate.
Any suggestions how to do that?
Thanks,
Tom