Filtering a listbox based on an earlier listbox in the form
Posted: Thu Jun 18, 2015 5:02 am
I think my organization of this DB might be non-standard. (?) I have as Hierarchy.
Courses (CourseID, CourseName)
Lessons (LessonID, CourseID [fkey])
Students (StudentID)--->StudentLessons (StudentID [fkey], CourseID [fkey], LessonDate, LessonID)
When I enter lessons that the student has done, I first want to select the course with a list box, then the LessonID with another listbox filtered on the CourseID selected. I can't figure out how to refer to the CourseID in the sql for the LessonID to filter. i remember being able to cascade listboxes in Access, but with the data being entered in the form I'm spinning my wheels trying to work it out. I have the Student Table with the StudentLessons table as a subform, which is why I wanted to use a listbox to get the CourseID, because it doesn't relate to Students. I need the Student table in the form in case I need to update student info (address, etc.). That probably sounds very confusing. All I really want to be able to do is enter the Course, then the Lessons done without having to scroll through 100s of records for the LessonID. Up to this point I've been typing them all in without Listboxes. Trying to save some time.
Courses (CourseID, CourseName)
Lessons (LessonID, CourseID [fkey])
Students (StudentID)--->StudentLessons (StudentID [fkey], CourseID [fkey], LessonDate, LessonID)
When I enter lessons that the student has done, I first want to select the course with a list box, then the LessonID with another listbox filtered on the CourseID selected. I can't figure out how to refer to the CourseID in the sql for the LessonID to filter. i remember being able to cascade listboxes in Access, but with the data being entered in the form I'm spinning my wheels trying to work it out. I have the Student Table with the StudentLessons table as a subform, which is why I wanted to use a listbox to get the CourseID, because it doesn't relate to Students. I need the Student table in the form in case I need to update student info (address, etc.). That probably sounds very confusing. All I really want to be able to do is enter the Course, then the Lessons done without having to scroll through 100s of records for the LessonID. Up to this point I've been typing them all in without Listboxes. Trying to save some time.