How can I retrieve the value of specified column of the selected row in a multicolumn listbox?
I populate the listbox by setting the RowSource property with a SQL string. BoundColumn set to value 1.
I can retrieve the value of the bound column (of the selected row) by using ListBox.Value
. But I also want the value of another column.
You can use the ListBox1. ListIndex property of the listbox to return the selection index on the listbox change event. If you've populated the listbox from a range it will be easy to pick up the relevant cells from your list (remembering that the listbox index value starts at 0 for the first item).
A multicolumn ListBox places items into as many columns as are needed to make vertical scrolling unnecessary. The user can use the keyboard to navigate to columns that are not currently visible.
Use listboxControl.Column(intColumn,intRow)
. Both Column and Row are zero-based.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With