469,361 Members | 2,349 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,361 developers. It's quick & easy.

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 3027
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

1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.