Dear reader(s),
I have a problem with my Microsoft Access database: I cannot use data from a subform which has to be used for another query. I will try to explain my situation as clear as possible.
Tables:
I have two tables: "ecprod" and "product".
"ecprod" consists of twelve columns, which contain information about products.
"product" contains all NEW products which have to be saved into "ecprod". (which is a table that does not have any relationships)
Subform description:
There are 3 objects in my subform (which is a datasheet view, so there are live updates): "lbProductName" (Listbox), "lbProductType" (Listbox) and "txtProductInfo" (Textbox). They all get their data from "product". The unique combination is "productName" and "productType" together to search for "productInfo". This information has to be saved in the table "ecprod".
The first SELECT-query (selection of all the products) is as follows:
SELECT DISTINCT productName
FROM product
WHERE ((productName.product)=(productName.ecprod));
This works. lbProductName is filled with the data from "product".
But now my question: (finally
)
How can I copy the selected value from lbProductName into a query to fill the lbProductType without duplicates? I have already tried to copy the live value of lbProductName, but Access gives a parameter error: the value of lbProductName has to be filled in and with this query
SELECT DISTINCT product.ProductType, product.ProductName
FROM product
WHERE ((tempProductName)=([product].[ProductName]));
or this query
SELECT DISTINCT product.ProductType, product.ProductName
FROM product
WHERE (([ecprod].[ProductName])=([product].[ProductName]));
I get duplicate values or an parameter error.
If anyone can help me I would really appreciate it!
Thanks in advance (and for reading this complete document
)
Jochen Boons,
The Netherlands
P.S.: If needed, I will make an internet page where my problem is visualized.
I have a problem with my Microsoft Access database: I cannot use data from a subform which has to be used for another query. I will try to explain my situation as clear as possible.
Tables:
I have two tables: "ecprod" and "product".
"ecprod" consists of twelve columns, which contain information about products.
"product" contains all NEW products which have to be saved into "ecprod". (which is a table that does not have any relationships)
Subform description:
There are 3 objects in my subform (which is a datasheet view, so there are live updates): "lbProductName" (Listbox), "lbProductType" (Listbox) and "txtProductInfo" (Textbox). They all get their data from "product". The unique combination is "productName" and "productType" together to search for "productInfo". This information has to be saved in the table "ecprod".
The first SELECT-query (selection of all the products) is as follows:
SELECT DISTINCT productName
FROM product
WHERE ((productName.product)=(productName.ecprod));
This works. lbProductName is filled with the data from "product".
But now my question: (finally
How can I copy the selected value from lbProductName into a query to fill the lbProductType without duplicates? I have already tried to copy the live value of lbProductName, but Access gives a parameter error: the value of lbProductName has to be filled in and with this query
SELECT DISTINCT product.ProductType, product.ProductName
FROM product
WHERE ((tempProductName)=([product].[ProductName]));
or this query
SELECT DISTINCT product.ProductType, product.ProductName
FROM product
WHERE (([ecprod].[ProductName])=([product].[ProductName]));
I get duplicate values or an parameter error.
If anyone can help me I would really appreciate it!
Thanks in advance (and for reading this complete document
Jochen Boons,
The Netherlands
P.S.: If needed, I will make an internet page where my problem is visualized.