Question Relations between tables (non-fixed)

Nicolas

New member
Local time
Today, 18:42
Joined
Mar 18, 2011
Messages
3
A friend of mine has a disease which causes him to get nauseus when eating certain products. We know which products these are and sadly we regulary find new products which cause this (severe) nausea. I wish to help this friend by making a database of all products and ingredients so that we might be able to find a common ingredient amongst them, so that we may test if this ingredient is the cause of the nausea and evade it.

To do this I have made two tables in Access 2007;
'Products' - With information on the product/brand/flavor
'Ingredients' - With information on the Ingredient/E-number/type

What I wish to do is make a relation of some sort which will allow me to put multiple ingredients to one product. I have tried to do this by creating a form (It seems the most logical way to do so, this way I can fill out the name of the product/brand/taste and either dropdown or yes/no select ingredients to add to the relation for this particular product.), but this to no avail. It seems I need to create a relation between the two tables before I can start on anything else. The problem here is that this relation is bound and unwanted relations are made.

===
For example;
Table 'Products': Table 'Ingredients
1. Chocolate chip cookies 1. Vitamin C
2. Cheeseburger 2. pepper powder
3. Orange 3. flour
etc.

Would give me the following relations
Chocolate chip cookies contain vitamin C
Cheeseburgers contain pepper powder (this one is actually possible ;))
Oranges contain flour.
===

I wish to be capable of selecting ingredients so that I can check for common ingredients between products, hoping to find the basic ingredients which cause the nausea. But right now I'm wondering if it is even possible. I can't find anything other then these types of relations.
Could anyone here help me with this? I would already be very happy if anyone got me a name of a function to google since I feel like I am at a dead end here.
 
You need a junction table as this is a many to many relationship. Many products can contain many ingredients.
 
Thanks for the quick reply, I am currently looking at junction tables. Will post how it worked.
 
I now have a database which works properly, I googled around and found out how to make these. For others searching, this video I found sums it up nicely:
(Not allowed due to low postcount, on youtube search for 'Access 2007 Tutorial 1.3. Many to Many Relationship' by djdates)

Thanks for helping me!

EDIT: This topic may be closed now, my answer is found :)
 

Users who are viewing this thread

Back
Top Bottom