Wow, this is driving me crazy.
Just started with Visual Basic Express 2008, after coming from an Access and VBA background.
All I am trying to do is loop through a multi-select listbox and retrieve all the selected items, but it doesnt want to play nice.
What I have tried:
For Each varItem In Me.ListBox1.SelectedItems
MsgBox(Me.ListBox1.Items.Item(varItem))
Next varItem
And I get the error message: Conversion from type 'DataRowView' to type 'Integer' is not valid.
The listbox is a single column bound item with string fields.
What am I missing?
Just started with Visual Basic Express 2008, after coming from an Access and VBA background.
All I am trying to do is loop through a multi-select listbox and retrieve all the selected items, but it doesnt want to play nice.
What I have tried:
For Each varItem In Me.ListBox1.SelectedItems
MsgBox(Me.ListBox1.Items.Item(varItem))
Next varItem
And I get the error message: Conversion from type 'DataRowView' to type 'Integer' is not valid.
The listbox is a single column bound item with string fields.
What am I missing?