Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 12th, 2005, 10:57 PM
NYprmr
Guest
 
Posts: n/a
Default 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...
  #2  
Old November 12th, 2005, 10:57 PM
Salad
Guest
 
Posts: n/a
Default Re: Get multiple values from Listbox with Multi Select property setto Simple

NYprmr wrote:
[color=blue]
> 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...[/color]


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

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles