Linking two tables

leungwai142

New Member
Joined
Jul 16, 2011
Messages
5
I am new to MS access, sorry if i am not making my questions clear enough.

I created two tables which are TabMaterial and TabProduct.

TabMaterial contains a list of material as follow:
  • Name, Type
  • Blue Plastic, Plastic
  • Red Plastic, Plastic
  • Blue Glass, Glass
  • Red Glass, Glass
  • Etc
TabProduct contains the products as follows:
  • Product, Material, Price
  • 001, Blue Plastic, 10
  • 002, Red Plastic, 20
  • 003, Red Plastic, 30
What can i do if i want to create a column in a query, which automaticly shows that if TabMaterial.Type is Plastic, product 001 is plastic as its material is blue plastic. as so as if TabMaterial.Type is glass.

So that it shows
  • Product, Material Type
  • 001, Plastic
  • 002, Plastic
  • 003, Plastic
  • Etc.
Thanks in advance.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Sorry. I missed one point. I know it can simply solve by creating a relationship. But in fact. Each products contains more than one material. so TabProduct should be the case:

Product, Material1, Material 2.
  • 001, Blue Plastic, Red Plastic
  • 002, Red Plastic, Blue Glass
  • 003, Red Glass, Blue Glass
And this is wt i want to show in the new query:

001, Plastic
002, Plastic & Glass
003, Glass
 
Upvote 0
The data you've posted isn't very clear.

Can aproduct consist of one or more materials and a material be used for more than one product?

eg Product 001 - Blue Plastic, Blue Glass
Product 003 - Blue Plastic, Red Glass *

If so that's a many-to-many relationship between products and materials.

You can represent that relationship with another table, let's call it ProductMaterial.

Each record in that table would have the primary key for the product and the material as fields.

* The data I use in the example is a simplification of what you might have.
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,543
Members
452,924
Latest member
JackiG

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