Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reverse One-To-Many

Status
Not open for further replies.

czarjosh

Technical User
Jul 14, 2002
79
US
I have one table that has a name and then 5 foreign key number fields. I want them all to be related to the corresponding tables. The dilemna i got is when i attempt to make the relationships it put in a one-to-many relationship. This is good, but it is in the wrong direction and when i try to drag it from another way it still does not work. The same when i try to design the relationship manually. WHat am I doing wrong?
 
Doesn't sound like you are doing anything wrong. Any time you link a foreign key to a primary key, Access assumes a one (Primary Side) to many (Foreign Side) relationship. Larry De Laruelle
ldelaruelle@familychildrenscenter.org

 
Hi Czarjosh,

Remember that your FK's (5 of them) will each link to ONE record only in 5 DIFFERENT tables, the FK is a value that points to the PK of another SINGLE record.
Your record with 5 FK's is the MANY - you can have MANY records with 5 FK's in it with ONE record from other tables related via their PK to each of these FK's.

In the following: tblTown is the MANY, because it will contain MANY records that are in Lancashire (tblCounty) and also in England (tblCountry)...
[tt]
tblCOUNTY tblTOWN
pk 1-----| pk
CountyName | TownName
|----M County_fk
StdCode
|----M Country_fk
tblCOUNTRY |
pk 1-----|
CountryName

This isn't a good example, because Country should have many Counties and County should have many Towns, but it illustrates what you are trying to do.
In essence, you will have many different Towns that are in London and England.

Please describe your tables here (table, PK's and FK's) if you still think that you've got the relationship idea right.

Regards,

Darrylle
"Never argue with an idiot, he'll bring you down to his level - then beat you with experience."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top