On a form I have two listboxes (lstCategory1, lstCategory2) where after I click an entry in the lstCategory1 listbox it sets the row source for lstCategory2. That part works fine. However what I’m having trouble with is after the row source for lstCategory2 is set I want the first item in the resulting list for lstCategory2 to be selected automatically.
I have the following code in the lstCategory1_Click event:
I have the following code in the lstCategory1_Click event:
Code:
Me.lstCategory2.Selected(0) = True
This visually selects the first list item in lstCategory2 but when I check the ItemsSelected collection for lstCategory2 it is empty, even though the first item visually appears to be selected. Am I missing something here?