Hi folks,
I have multiple combos working together correctly as follows:
Year
Location
Course
Student
The combos bring back the correct records for that individual student in a subform when the last combobox (student) is selected using the following code in the afterupdate of the student combobox
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.Find "[Studentid] = " & Str(Nz(Me![CboStudent], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
I'd like to break this down further so when i select
1. Year: it will bring me back all records for that year,
2. Location: it will bring back all records for locations that match the year selected in the previous combo
3. Course: it will bring back all records for courses that match the year and location selected in the previous combos
4. Student: it will bring back all records for that student that match the year, location, course selected in the previous combos (This is currently working with the code above)
How can i include the code above to each previous combo afterupdate step to break down the records further.
I'm thinking in my mind it would be similar to the following for the Course Combo but i cannot get it to work:
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.Find "[Yearid] & [Locationid] & [Courseid] = " & Str(Nz(Me![CboYear],[CboLocation], [CboCourse], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Any ideas please are appreciated