How to use relationships to mirror a mutual field

Joined
Dec 17, 2013
Messages
37
Hi,

I am creating an inventory for producing orders. I have a supplier table and a product table at the moment. I would like the product table to show the supplier name based on the supplier code in the supplier table. I have created a relationship between the primary key in the supplier table and the supplier code field in the product table, but i am unaware how to mirror the mutual records into the product table. Could somebody please help me out? Sorry for the complicated question.

Thanks in advance,

HeyYouYesYouNoNotYouYou
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Thanks for the link. I have tried to think of an easier way to explain this; basically what i want is field data to change/update based on another field data. For example say i have a table which records suppliers and stored in there is supplier "A" with ID 1 and supplier "B" with ID 2. I would want the data for supplier to update or change in the products table based on the code which is entered into the supplier ID code field in the product table. So say a vase is supplied by supplier A, i would enter the number one into the supplier ID field and the database would then enter "A" into the supplier name field.

Thanks
 
Last edited:
Upvote 0
You're welcome. Getting your tables and relationships set up to support your business is key to a useful database application.
Good luck.
 
Upvote 0
This isn't a many to many relationship. I don't use access, but you don't have the supplier data in the the products table. The only thing that should be in the products table supplier related, would be the supplier primary key.

If you want to see the supplier info then you run a query to join the tables.
 
Upvote 0
Kyle123,

Probably, but if the Supplier supplies many Products, and If a Product can be supplied by many Suppliers, then it's possible that ProductA was supplied by SupplierX and other ProductA was supplied by SupplierQ. I was suggesting a general case, since I don't know the specifics. I recommended a video for the original poster to review. He/she can determine if the many to many is real.

See the Manufacturers and Products in this model.
Products and Manufacturers Data Model

I set up relationships in the relationships window for referential integrity.
 
Last edited:
Upvote 0
Here's another example of the many Suppliers to many Products where a junction table Suppliers_Products is used to resolve the M:M.
see the model at Data Model for Supply Chains
 
Upvote 0
Thanks for the link. I have tried to think of an easier way to explain this; basically what i want is field data to change/update based on another field data. For example say i have a table which records suppliers and stored in there is supplier "A" with ID 1 and supplier "B" with ID 2. I would want the data for supplier to update or change in the products table based on the code which is entered into the supplier ID code field in the product table. So say a vase is supplied by supplier A, i would enter the number one into the supplier ID field and the database would then enter "A" into the supplier name field.

Use a combo box control.

Note: You only store the supplier's name in the suppliers table. In all other table you only store just the primary key as a foreign key. You use the Primary key to look up the name as needed. By doing this you are using the power of a relational database to avoid storing duplicate data.

I would also recommend taking a look at the Northwind sample database and the the Orders template.


Highly recommended reading: Inventory Control: Quantity on Hand
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,684
Members
449,116
Latest member
HypnoFant

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top