R
Robert Painter
Hi
have grabbed code for cascading list/cbo boxes and adapted to hopefully
suit.
lstCategory from tblcategories.categorydescription
lstSkill from tblskill.skilldescription
using the following code:
Private Sub lstCategory_AfterUpdate()
Dim strCateg As String
Dim varSelected As Variant
If Me.lstCategory.ItemsSelected.Count > 0 Then
For Each varSelected In Me.lstCategory.ItemsSelected
strCateg = strCateg & "'" & Me.lstCategory.ItemData(varSelected) & "',
"
Next varSelected
strCateg = Left(strCateg, Len(strCateg) - 2)
Me.LstSkill.RowSource = "SELECT SkillDescription " & _
"FROM tblSkills " & _
"WHERE tblCategory IN (" & strCateg & ") " & _
"ORDER BY SkillDescription"
End If
I cannot get rowsource populated hence nothing showing in lstSkill
Any ideas of what i am doing wrong.
Have managed to cascade but done another way but lst only refreshes when
focused.
Robert
have grabbed code for cascading list/cbo boxes and adapted to hopefully
suit.
lstCategory from tblcategories.categorydescription
lstSkill from tblskill.skilldescription
using the following code:
Private Sub lstCategory_AfterUpdate()
Dim strCateg As String
Dim varSelected As Variant
If Me.lstCategory.ItemsSelected.Count > 0 Then
For Each varSelected In Me.lstCategory.ItemsSelected
strCateg = strCateg & "'" & Me.lstCategory.ItemData(varSelected) & "',
"
Next varSelected
strCateg = Left(strCateg, Len(strCateg) - 2)
Me.LstSkill.RowSource = "SELECT SkillDescription " & _
"FROM tblSkills " & _
"WHERE tblCategory IN (" & strCateg & ") " & _
"ORDER BY SkillDescription"
End If
I cannot get rowsource populated hence nothing showing in lstSkill
Any ideas of what i am doing wrong.
Have managed to cascade but done another way but lst only refreshes when
focused.
Robert