Hi,
Im using Access 2000.
Essentially I want to find out which of the entries in my master table have matching entries in my other tables, and list the ones that do.
So if I have an entry in the master table for “productA”, and there are also matching entries for “productA” in tables “SupplierC” and “SupplierD”. I want to perform a query that will output a list showing “SupplierC” and “SupplierD” (I have A & B tables but if there isn’t an entry in them for “ProductA” I don’t want them on the list.)
I intend to use the results to populate the values of a combo box in future so I require the list to be in a single column, rather than across many columns. Does anyone know if this is possible?
My master table is called “OurProductsTable” and the four supplier tables are called “SupplierA”, “SupplierB”, “SupplierC”, and “SupplierD”.
Each Table has a primary key called “ProductID” and I have linked them together on the relationships screen.
I’m not sure if this is the proper method but I also made another field in each of the supplier tables called “CompanyName” and set the default value as the name of each supplier, so if the entry for supplierC matches the master table entry I can return the “CompanyName” value of “SupplierC”.
Here’s what I thought the code should kind of look like but I don’t know how to apply it properly in a query:
If ([SupplierA].[ProductID] = [OurProductsTable].[ProductID] then [SupplierA].[CompanyName])
If ([SupplierB].[ProductID] = [OurProductsTable].[ProductID] then [SupplierB].[CompanyName])
If ([SupplierC].[ProductID] = [OurProductsTable].[ProductID] then [SupplierC].[CompanyName])
If ([SupplierD].[ProductID] = [OurProductsTable].[ProductID] then [SupplierD].[CompanyName])
Any ideas would be welcomed gratefully. Thank you
Im using Access 2000.
Essentially I want to find out which of the entries in my master table have matching entries in my other tables, and list the ones that do.
So if I have an entry in the master table for “productA”, and there are also matching entries for “productA” in tables “SupplierC” and “SupplierD”. I want to perform a query that will output a list showing “SupplierC” and “SupplierD” (I have A & B tables but if there isn’t an entry in them for “ProductA” I don’t want them on the list.)
I intend to use the results to populate the values of a combo box in future so I require the list to be in a single column, rather than across many columns. Does anyone know if this is possible?
My master table is called “OurProductsTable” and the four supplier tables are called “SupplierA”, “SupplierB”, “SupplierC”, and “SupplierD”.
Each Table has a primary key called “ProductID” and I have linked them together on the relationships screen.
I’m not sure if this is the proper method but I also made another field in each of the supplier tables called “CompanyName” and set the default value as the name of each supplier, so if the entry for supplierC matches the master table entry I can return the “CompanyName” value of “SupplierC”.
Here’s what I thought the code should kind of look like but I don’t know how to apply it properly in a query:
If ([SupplierA].[ProductID] = [OurProductsTable].[ProductID] then [SupplierA].[CompanyName])
If ([SupplierB].[ProductID] = [OurProductsTable].[ProductID] then [SupplierB].[CompanyName])
If ([SupplierC].[ProductID] = [OurProductsTable].[ProductID] then [SupplierC].[CompanyName])
If ([SupplierD].[ProductID] = [OurProductsTable].[ProductID] then [SupplierD].[CompanyName])
Any ideas would be welcomed gratefully. Thank you