I was trying to get click event through module for list box
Form Load
List1
Module
in list1 there are two same Subroutines in select case block [a] .. when I try to execute click event for 2nd Subroutines having the same case [a] .. it shows the value of first one whereas as it has assigned different value
First a is apple , banana
2nd a is rat, cat
but 2nd a when clicked it does not show rat, cat but apple banana ... How I can execute them separately
Form Load
Code:
Private Sub Form_Load()
With List1
.AddItem "a"
.AddItem "a"
.AddItem "a"
.AddItem "a"
.AddItem "a"
End WIth
End Sub
Code:
Private Sub List1_Click()
List2.Clear
Select Case List1.Text
Case "a": List2_Item_1
Case "b": List2_Item_2
Case "c": List2_Item_3
Case "a": List2_Item_4
Case "d": List2_Item_5
End Select
End Sub
Code:
Public Sub List1_Item_1()
With Form1.List2
.AddItem "apple"
.AddItem "banana"
End with
End Sub
Public Sub List1_Item_2()
With Form1.List2
.AddItem "bat"
.AddItem "ball"
End with
End Sub
Public Sub List1_Item_3()
With Form1.List2
.AddItem "rat"
.AddItem "cat"
End with
End Sub
Public Sub List1_Item_4()
With Form1.List2
.AddItem "orange"
.AddItem "penut"
End with
End Sub
Public Sub List1_Item_5()
With Form1.List2
.AddItem "simple"
.AddItem "hard"
End with
End Sub
in list1 there are two same Subroutines in select case block [a] .. when I try to execute click event for 2nd Subroutines having the same case [a] .. it shows the value of first one whereas as it has assigned different value
First a is apple , banana
2nd a is rat, cat
but 2nd a when clicked it does not show rat, cat but apple banana ... How I can execute them separately