Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP PLS!! This subform is making me mental

Status
Not open for further replies.

tpalmer00

Technical User
Dec 5, 2007
5
Hi,

Sorry to be a drama queen but this is really starting to do my head in lol

I've created a form which works fine on it's own. When I move it to the main form and embed it as a subform the filtered combo boxes don't work. I've tried all sorts of code to get the filters working again but to no avail.

All i want to do is use my Training Profile form to be able to select the employee and then use the first cbo box to select a Course Category. The second cbo box then filters according to the Course Category chosen and displays a list of course names relevent to the specified category chosen.

When i embed as a subform is gives me this error: Forms!KBTPContentForm.cboCategory

Rowsource for Category cbo box:

SELECT CourseCategories.CategoryID, CourseCategories.CategoryName FROM CourseCategories ORDER BY CourseCategories.CategoryName;

Rowsource for Course cbo box:

SELECT Courses.CourseID, Courses.CourseName, Courses.CategoryID FROM Courses WHERE (((Courses.CategoryID)=Forms!KBTPContentForm.cboCategory)) ORDER BY Courses.CourseName;

Code for form:
Private Sub Category_AfterUpdate()

Me.cboProduct.RecordSource = "SELECT * from Products WHERE Category = '" & Me.cboCategory & "'"

Me.cboProduct.RecordSource.Requery


End Sub

Any advice appreciated,
Thanks Trish
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top