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!

Setting up problems

Status
Not open for further replies.

mearmortal

Programmer
May 1, 2002
79
GB
I have a main table with two references:

Part
Station

Part is linked to a table containing a list of Parts
Station is linked to a table containing a list of stations

Now what I want to do is specify a Number for Calculation purposes against each possible combination of both Part and Station
The same value must be present if the same combination is re-applied.

i.e.

Part Station Number
1 1 1234
2 1 2345
1 2 3232
2 2 4343
2 3 3434
2 4 1212
1 3 2424
1 1 1234
2 2 4343

The problem I have is that if I add relationship to the main table from another table containing the [Number] I have a Many to Many relationship. I don't know how to handle this.

If I add the relationship to the table containing the Part Information and the table containing the Station Information I get the One-to-many relationship but I dont get any records.

Any suggestions please.
 
A many-to-many relationship requires an intermediate table:

Part - PartStation - Station

The intermediate table contains only two fields: an ID pointing to the Part and an ID pointing to the Station. If you put a compound key on both fields, this combination is be forced to be unique.

After you have created the intermediate table, you have two one-to-many relations (1 Part, many PartStations and 1 Station, many PartStations)

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top