Good day
I am creating a bill of materials program.
There are two main tables named Products and Sub_Products.
In the Products table, the fields are (Product_Name, Code). In the Sub_Products table, the fields are (Code, Sub_Name).
The tables are linked with code, i.e.: one product is made up of many sub_products, each sub_product is a product as well, making it have many sub_products.
I have created a query that reads a product and gets its sub_products. I need a query to compare Sub_Name with Product_Name and then check more sub_products, continuing until no more sub_products are found.
I created a query that gets product_name than gets component_name, than another query to change component_name to product_name and get its component
So every time I have to manually create a query to see the next level, is there no other way..
Quert sql statement for 4th Query---------
SELECT [Query3rd].Component_Name, products101.Our_Product_Code, products101.Product_Name, Sub_Products101.Component_Name FROM (Query3rd INNER JOIN products101 ON [Query3rd].Component_Name=products101.Product_Name) INNER JOIN Sub_Products101 ON products101.Our_Product_Code=Sub_Products101.Our_Product_Code WHERE ((([Query3rd].Component_Name)=(products101.Product_Name)));