M
Martin
I work in a school and am trying to link three list controls together so that
choosing a year group in List A results in a list of classes in List B.
Choosing a class in B results in a list of students in List C.
i.e.
A B C
Year Group -> Class Group -> Student List
The problem is that List C contains student names but they are not dislayed.
The effect is similar to setting the text colour to white. Thus while I can
select a student by clicking on the list C, I do not know which student it is
since the list appears to be empty.
The correct data is in the control (verified through VBA), the items can be
selected (a solid black bar highlights the student's name), and the selected
items can be extracted through VBA.
The text colour is not white.
The column width is blank (and setting this to 6cm has no effect)
The code for clicking on YearGroup (A) (and filling teaching group (B) -
working) is
Private Sub lstYearGroup_AfterUpdate()
Me!lstRegGroup.RowSource = "SELECT knownRegGroup.RegGroup FROM knownRegGroup
WHERE (((knownRegGroup.[Year Group])=""" & Me!lstYearGroup.Value & """));"
Me!lstRegGroup.Requery
Me!lstStudent.RowSource = ""
Me!lstStudent.Requery
End Sub
The code of clicking on Reg group (B) (and filling student list C - not
working) is
Private Sub lstRegGroup_AfterUpdate()
Dim strSQL As String
strSQL = "SELECT knownPupils.Student FROM knownPupils "
strSQL = strSQL & "WHERE (((knownPupils.[Year Group]) = """ &
Me!lstYearGroup.Value & """) And ((knownPupils.[Reg Group]) = """ &
Me!lstRegGroup.Value & """)) "
strSQL = strSQL & "ORDER BY knownPupils.Student;"
Me!lstStudent.RowSource = strSQL
Me!lstStudent.Requery
End Sub
Any suggestions would be welcome.
Many thanks
Martin.
choosing a year group in List A results in a list of classes in List B.
Choosing a class in B results in a list of students in List C.
i.e.
A B C
Year Group -> Class Group -> Student List
The problem is that List C contains student names but they are not dislayed.
The effect is similar to setting the text colour to white. Thus while I can
select a student by clicking on the list C, I do not know which student it is
since the list appears to be empty.
The correct data is in the control (verified through VBA), the items can be
selected (a solid black bar highlights the student's name), and the selected
items can be extracted through VBA.
The text colour is not white.
The column width is blank (and setting this to 6cm has no effect)
The code for clicking on YearGroup (A) (and filling teaching group (B) -
working) is
Private Sub lstYearGroup_AfterUpdate()
Me!lstRegGroup.RowSource = "SELECT knownRegGroup.RegGroup FROM knownRegGroup
WHERE (((knownRegGroup.[Year Group])=""" & Me!lstYearGroup.Value & """));"
Me!lstRegGroup.Requery
Me!lstStudent.RowSource = ""
Me!lstStudent.Requery
End Sub
The code of clicking on Reg group (B) (and filling student list C - not
working) is
Private Sub lstRegGroup_AfterUpdate()
Dim strSQL As String
strSQL = "SELECT knownPupils.Student FROM knownPupils "
strSQL = strSQL & "WHERE (((knownPupils.[Year Group]) = """ &
Me!lstYearGroup.Value & """) And ((knownPupils.[Reg Group]) = """ &
Me!lstRegGroup.Value & """)) "
strSQL = strSQL & "ORDER BY knownPupils.Student;"
Me!lstStudent.RowSource = strSQL
Me!lstStudent.Requery
End Sub
Any suggestions would be welcome.
Many thanks
Martin.