ethan1701
Technical User
- Jan 10, 2003
- 16
Hi,
I have a database for managing my inventory, sales, orders, etc.
For the sake of easy search, updating and reporting, I grouped my products into categories, via a Categories table, and each product had a Products_category_ID, which tells me in what category it is.
I created a form called sales, which has a sub-form named sales_details. In the subform, I list all the products sold in any particular order. I've created a drop down list (Combo box) of the products, but here's what I want to do:
I've created a categories drop-down, where I can select a category, and then only it's products will appear in the products drop down. I did this by writing the following in the products Row Source attribute:
SELECT products.Products_name, products.Products_id FROM products WHERE products.Products_categories_id=products_category ORDER BY products.Products_name;
My problem is that the categories drop down is only willing to hod one value, across multiple records. That is, if I select category A, it is selected for all the records, and I can't see products of other categories. This prevents me from updating the sale of products from several categories. Another problem with this is the fact that when I look at existing records in the form, I don't see the products in all the records, but only those that are in the selected category.
Can you please help me find a way to make this work?
thanks,
-Ethan
I have a database for managing my inventory, sales, orders, etc.
For the sake of easy search, updating and reporting, I grouped my products into categories, via a Categories table, and each product had a Products_category_ID, which tells me in what category it is.
I created a form called sales, which has a sub-form named sales_details. In the subform, I list all the products sold in any particular order. I've created a drop down list (Combo box) of the products, but here's what I want to do:
I've created a categories drop-down, where I can select a category, and then only it's products will appear in the products drop down. I did this by writing the following in the products Row Source attribute:
SELECT products.Products_name, products.Products_id FROM products WHERE products.Products_categories_id=products_category ORDER BY products.Products_name;
My problem is that the categories drop down is only willing to hod one value, across multiple records. That is, if I select category A, it is selected for all the records, and I can't see products of other categories. This prevents me from updating the sale of products from several categories. Another problem with this is the fact that when I look at existing records in the form, I don't see the products in all the records, but only those that are in the selected category.
Can you please help me find a way to make this work?
thanks,
-Ethan