tpalmer00
Technical User
- Dec 5, 2007
- 5
Hi,
I'm currently working on a project which is a lot more difficult than i thought it would be. I created a form which has 2 combo boxes: Category and product. When the user selects the Category I want the product cbo box to filter only the products from that particular category.
The form I built works perfect. However, when i go to add it in as a subform the product cbo box no longer presents a list. I get a box that asks for the parameter value - Forms!KBTPContentForm!Category
I'm sure I just need to repoint the code but haven't had any luck so far. Below is the code attached.
Category cbo box. After Update code:
Private Sub Category_AfterUpdate()
Product = Null
Product.Requery
Product = Me.Product.ItemData(0)
End Sub
Private Sub Form_Current()
Me.Product.Requery
End Sub
Private Sub Form_Load()
If IsNull(Category) Then
Category = Me.Category.ItemData(0)
Call Category_AfterUpdate
End If
End Sub
Expression attached to product cbo (rowsource)
SELECT Courses.CourseID, Courses.CourseName, Courses.CategoryID FROM Courses WHERE (((Courses.CategoryID)=Forms!KBTPContentForm!Category)) ORDER BY Courses.CourseName;
I should say that the framework for the system sits on a form called Frm_CatProd which has tab control pages. The subform (which doesn't work) sits on a page called Criteria.
Can anyone point me in the right direction??
Many Thanks,
Trish
I'm currently working on a project which is a lot more difficult than i thought it would be. I created a form which has 2 combo boxes: Category and product. When the user selects the Category I want the product cbo box to filter only the products from that particular category.
The form I built works perfect. However, when i go to add it in as a subform the product cbo box no longer presents a list. I get a box that asks for the parameter value - Forms!KBTPContentForm!Category
I'm sure I just need to repoint the code but haven't had any luck so far. Below is the code attached.
Category cbo box. After Update code:
Private Sub Category_AfterUpdate()
Product = Null
Product.Requery
Product = Me.Product.ItemData(0)
End Sub
Private Sub Form_Current()
Me.Product.Requery
End Sub
Private Sub Form_Load()
If IsNull(Category) Then
Category = Me.Category.ItemData(0)
Call Category_AfterUpdate
End If
End Sub
Expression attached to product cbo (rowsource)
SELECT Courses.CourseID, Courses.CourseName, Courses.CategoryID FROM Courses WHERE (((Courses.CategoryID)=Forms!KBTPContentForm!Category)) ORDER BY Courses.CourseName;
I should say that the framework for the system sits on a form called Frm_CatProd which has tab control pages. The subform (which doesn't work) sits on a page called Criteria.
Can anyone point me in the right direction??
Many Thanks,
Trish