Here is a summary of my successful a dependent combo boxe on the Same form. Thanks PHV for the help. Molly
==================
PURPOSE: Have a dependent 2nd combo box show only the products that pertain to the 1st combo box selection. They are both on the same subform.
In frmMyProducts:
1 - In the #1 combox box field Name cboCategoryID with a Control Source of CategoryID:
Row Source :
SELECT tblCategory.CategoryID, tblCategory.CategoryName FROM tblCategory;
After Update Event:
Private Sub cboCategoryID_AfterUpdate()
Me!cboProductID.RowSource = "SELECT ProductID,CategoryID,ProductName FROM tblProduct WHERE CategoryID=" & Me!cboCategoryID
End Sub
2 - In the #2 combox box field Name cboProductID with a Control Source of ProductID:
Row Source:
SELECT tblProduct.ProductID, tblProduct.CategoryID, tblProduct.ProductName FROM tblProduct WHERE (((tblProduct.CategoryID)=Forms!frmMain!cboCategoryid));
After Update Event:
Private Sub cboProductID_AfterUpdate()
cboCategoryID.Requery
End Sub
3 - The tblCategory has 2 fields: CategoryID and CategoryName
4 - The tblProduct has 2 fields: ProductID, ProductName, CategoryID
5 - The junction table tblMyChosenProducts has 2 fields: CategoryID and ProductID