By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,934 Members | 1,476 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,934 IT Pros & Developers. It's quick & easy.

Why is it sometimes necessary to join two fields in one table to two fields in anothe

P: 1
An Access book I looked at called this topic "creating a relationship on multiple fields." I want to know why this is necessary. For example, I found it necessary to link two fields between two tables in recalculating inventory quantities to reduce appropriately the number of records returned in the query. Two of the 4 tables involved in my inventory queries had a compound primary key, i.e. two fields in the table were primary keys. Do 2 primary keys necessitate two links between tables? If not, what is the reason that two links between 2 tables is necessary?
Jan 22 '15 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 1,240
Think about the relationship between the data in the tables. Suppose you sell the same item from more than one warehouse. Imagine a sales order to sell an item. The sales order must specify both the item number and the warehouse to pull stock from. So the relationship between that one line item on a sales order and the item-warehouse table must include two pieces of data to find the right row to reduce the stock from.

If you stop looking in the item-warehouse file after you find the item you may reduce stock from the wrong warehouse. If you look only for the warehouse you may reduce stock for the wrong item.

Jim
Jan 22 '15 #2

Post your reply

Sign in to post your reply or Sign up for a free account.