J John May 12, 2008 #1 Hi How can I get the value of the third column of a multi-select list box? Thanks Regards
T Tom van Stiphout May 12, 2008 #2 On Mon, 12 May 2008 02:46:46 +0100, "John" <[email protected]> wrote: Me.SomeListbox.Column(2) will return the value in column 3 of the selected row. -Tom.
On Mon, 12 May 2008 02:46:46 +0100, "John" <[email protected]> wrote: Me.SomeListbox.Column(2) will return the value in column 3 of the selected row. -Tom.
T Tom Wickerath May 12, 2008 #3 Hi Tom, Me.SomeListbox.Column(2) will return the value in column 3 of the selected row. Click to expand... That only works with a single select list box (Multiselect property set to None). Try something like this, instead: Function InterateSelections() As Variant On Error GoTo ProcError Dim varCategory As Variant For Each varCategory In Me.SomeListbox.ItemsSelected() Debug.Print Me.lboProjects.Column(2, varCategory) Next varCategory ExitProc: Exit Function ProcError: MsgBox "Error " & Err.Number & ": " & Err.Description, _ vbCritical, "Error in InterateSelections Function..." Resume ExitProc End Function Tom Wickerath Microsoft Access MVP http://www.accessmvp.com/TWickerath/ http://www.access.qbuilt.com/html/expert_contributors.html __________________________________________ : Me.SomeListbox.Column(2) will return the value in column 3 of the selected row. -Tom. __________________________________________ : Hi How can I get the value of the third column of a multi-select list box? Thanks Regards
Hi Tom, Me.SomeListbox.Column(2) will return the value in column 3 of the selected row. Click to expand... That only works with a single select list box (Multiselect property set to None). Try something like this, instead: Function InterateSelections() As Variant On Error GoTo ProcError Dim varCategory As Variant For Each varCategory In Me.SomeListbox.ItemsSelected() Debug.Print Me.lboProjects.Column(2, varCategory) Next varCategory ExitProc: Exit Function ProcError: MsgBox "Error " & Err.Number & ": " & Err.Description, _ vbCritical, "Error in InterateSelections Function..." Resume ExitProc End Function Tom Wickerath Microsoft Access MVP http://www.accessmvp.com/TWickerath/ http://www.access.qbuilt.com/html/expert_contributors.html __________________________________________ : Me.SomeListbox.Column(2) will return the value in column 3 of the selected row. -Tom. __________________________________________ : Hi How can I get the value of the third column of a multi-select list box? Thanks Regards
T Tom Wickerath May 12, 2008 #4 Debug.Print Me.lboProjects.Column(2, varCategory) Of course, you have to use the same list box name in the Debug.Print statement <shy grin> Tom Wickerath Microsoft Access MVP http://www.accessmvp.com/TWickerath/ http://www.access.qbuilt.com/html/expert_contributors.html
Debug.Print Me.lboProjects.Column(2, varCategory) Of course, you have to use the same list box name in the Debug.Print statement <shy grin> Tom Wickerath Microsoft Access MVP http://www.accessmvp.com/TWickerath/ http://www.access.qbuilt.com/html/expert_contributors.html