Retrieve column values of the selected row of a multicolumn Access listbox

倾然丶 夕夏残阳落幕 提交于 2019-11-30 07:08:51

问题


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.


回答1:


Use listboxControl.Column(intColumn,intRow). Both Column and Row are zero-based.




回答2:


Just a little addition. If you've only selected 1 row then the code below will select the value of a column (index of 4, but 5th column) for the selected row:

me.lstIssues.Column(4)

This saves having to use the ItemsSelected property.

Kristian




回答3:


For multicolumn listbox extract data from any column of selected row by

 listboxControl.List(listboxControl.ListIndex,col_num)

where col_num is required column ( 0 for first column)



来源:https://stackoverflow.com/questions/4649000/retrieve-column-values-of-the-selected-row-of-a-multicolumn-access-listbox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!