Combo Boxes



I have a subform which has several combo boxes on it. The first comb
box provides the name of a product. Each product has several grades
The products are in one table (tblProduct) with fields ProductI
(Autonumber) and Product. The second combo box provides the names o
product grades. Grades are in tblGrades and have ProductID an
Grades. It is a one to many relationship (tblProducts being the on
side tblGrades being the many side. After I have chosen the product
the Grades combo box shows all the grades from all the products. Ho
can I get it to show only the grades from the product I have chose
from the combo box?
I have tried [Forms]![frmOrders].[Forms].[fsubCategories]![Product] i
the query in Grades row source but that doesn't work.

Any suggestions gratefully received



[MVP] S.Clark

In the afterUpdate event for cboProducts, put some code like the following:

If not isnull cboProduct then
cboGrade.RowSource = "Select GradeID, GradeName from tblProductGrades
WHERE ProductID = " & cboProduct
cboGrade.RowSource = "tblProductGrades"
End If

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question