Reversed Relationships

  • Thread starter Thread starter Melinda
  • Start date Start date
M

Melinda

I have two related tables and the relationship is
backwards.

TablePhone has a primary key of PhoneDBID. PhoneDBID is
included in the TableBroker as a foreign key. When I
create the relationship I get one phone number to many
brokers instead of one broker to many phone numbers.

Where have I gone wrong?

Melinda
 
Melinda said:
I have two related tables and the relationship is
backwards.

TablePhone has a primary key of PhoneDBID. PhoneDBID is
included in the TableBroker as a foreign key. When I
create the relationship I get one phone number to many
brokers instead of one broker to many phone numbers.

Where have I gone wrong?

Melinda

You've set up your table relationships incorrectly. Each broker can have
one OR MORE phone numbers, but each phone number belongs to ONE AND ONLY
ONE broker, correct? So tblBrokers is related 1:m to tblPhone, not the
other way around. You have to put the primary key from the table one the
"one" side into the table on the "many" side as a foreign key to create
the correct relationship. So "one" broker in tblBrokers:

BrokerID FirstName LastName
1 Joe Blow
2 Jane Doe
3 Richard Roe

....appears "many" times in tblPhones:

PhoneNum BrokerID
555-1212 1
555-2345 1
555-9876 1
222-4444 2
666-6666 3
777-8901 3

hth,

LeAnne
 
Back
Top