HomeGrowth
Technical User
I am seeking advice on relationship on a Company Profile Database. The objective is to do minimum data entry to link the all companies which have relationship among others.
Initially, I have two tables: One called tblCompanyInfo to store the company name, address, and service provided. Another call tblCompanyRelationship to store the relationship among others. I used two fields to make up the primary key, there are FirstCompany and SecondCompany . The 3rd filed is the relationship description, it included (for examples):
1. Company A is purchased by Company B (Company B’s old name is Company A)
2. Company C is the manufacturer for Company D (D is the distributor)
3. Company E is supplier for Company F (the source material that Company F makes is coming from Company E)
I already created the tables and form to try it out. Here is my problem for relationship # 1 above. I have a list of companies which was purchased one to another up to 4 level. For example:
Company A is purchased by Company B, Company B is purchased by Company C, Company C is purchased by Company D. In the tblCompanyRelationship, I have to enter 3 records for each company to record the relation, which means I have enter 12 records in tblCompanyRelationship to get the full referencing all 4 companies. This will become maintenance nightmare. It could nice that for each record, all I need to do is entering one relationship record (who is purchased who), and then when you take a look for a company, you would know this company is now Company D every time you look at Companies A, B, or C.
Is it called Many-to-Many relationship? How do you do it? Many thanks.
Initially, I have two tables: One called tblCompanyInfo to store the company name, address, and service provided. Another call tblCompanyRelationship to store the relationship among others. I used two fields to make up the primary key, there are FirstCompany and SecondCompany . The 3rd filed is the relationship description, it included (for examples):
1. Company A is purchased by Company B (Company B’s old name is Company A)
2. Company C is the manufacturer for Company D (D is the distributor)
3. Company E is supplier for Company F (the source material that Company F makes is coming from Company E)
I already created the tables and form to try it out. Here is my problem for relationship # 1 above. I have a list of companies which was purchased one to another up to 4 level. For example:
Company A is purchased by Company B, Company B is purchased by Company C, Company C is purchased by Company D. In the tblCompanyRelationship, I have to enter 3 records for each company to record the relation, which means I have enter 12 records in tblCompanyRelationship to get the full referencing all 4 companies. This will become maintenance nightmare. It could nice that for each record, all I need to do is entering one relationship record (who is purchased who), and then when you take a look for a company, you would know this company is now Company D every time you look at Companies A, B, or C.
Is it called Many-to-Many relationship? How do you do it? Many thanks.