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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Many to One

Status
Not open for further replies.

Mary10k

IS-IT--Management
Nov 8, 2001
103
US
How do I prevent the user from entering multiple records in the one side of a relationship?
 
Mary,
Not sure what you mean here....the 'one' side has to be unique, so this wouldn't be possible. If it's what access calls an 'intermediate' relationship, ie with a non-unique field on what you assume is the 'one' side, then it's not a real one to many, so this wouldn't apply.
--Jim
 
how would i connect one account with many phone numbers? Would I join the primary key from the account table to the foreign key to the phone table?
 
Mary,
Yes, you'd have the Account table's PrimaryKey in the Phone table as a foriegn key. The phone table could have the phone# itself be the primary key of that table, but then you couldn't have a phone number belong to more than one account--which could be the case, say if one of the account's phone #'s was a company phone, and other accounts used that same phone#.

Two ways around that--First, the easy way, just make some other field be the key of the phone table, such as a sequential number--now you won't be 'normalized', but that's not the end of the world.

Second, the right way (but more complex when it comes to the query logic), is to have an intermediate table between the phone & Account table. If you want more info on that, let me know. Many people choose the first way, it's really not a bad way to go.

--Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top