Combo Boxes

  • Thread starter Thread starter jimblob21
  • Start date Start date
J

jimblob21

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
 
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
Else
cboGrade.RowSource = "tblProductGrades"
End If
 
Back
Top