472,147 Members | 1,281 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,147 software developers and data experts.

Get multiple values from Listbox with Multi Select property set to Simple

Hi All,
I'm trying to get value from Listbox where Multi Select property is
set to Simple, meaning multiple values can be selected.
Doing regular loop like following, retuns NULL value for each data
item.
==========================================
lCount = Me!lstProblemType.ListCount
For varItem = 0 To lCount
If Me!lstProblemType.Selected(varItem) = True Then
strDescr = strDescr & "," &
Trim(Me!lstProblemType.ItemData(varItem))
End If
Next
==========================================
Please advice if you have any expirience.

Regards...
Nov 12 '05 #1
1 3299
NYprmr wrote:
Hi All,
I'm trying to get value from Listbox where Multi Select property is
set to Simple, meaning multiple values can be selected.
Doing regular loop like following, retuns NULL value for each data
item.
==========================================
lCount = Me!lstProblemType.ListCount
For varItem = 0 To lCount
If Me!lstProblemType.Selected(varItem) = True Then
strDescr = strDescr & "," &
Trim(Me!lstProblemType.ItemData(varItem))
End If
Next
==========================================
Please advice if you have any expirience.

Regards...

I usually use ItemsSelected. Air code
Dim var As Variant
Dim strDesc As String
For each var in Me.ListBoxName.ItemsSelected
'specify column, row. In this case, column zero
strDesc = strDesc & Me.ListBoxName.Column(0,var)
Next

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.