Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding how many selections made in list 2

Status
Not open for further replies.

fileman1

Technical User
Feb 7, 2013
152
GB
I have a list box, set as simple.

Is there a way to know when just one item has been selected in advance of the code below?

Code:
      For Each item In Me.DW.ItemsSelected
        strlist = Me.DW.Column(1, item)
      Next item

If one item (word) has been selected then I want to offer an edit function of the word. The offer of the edit function gets taken away if mulitiple items have been selected.
 
you can use the count property of the itemsselected collection.
 
Thanks, I used
Code:
Me.Label33.Caption = Me.DW.ItemsSelected.Count
 
Now I cannot find how to get the output/value of the item selected.

If Me.DW.ItemsSelected.Count = 1 Then
??
 
What about this ?
strlist = Me.DW.Column(1, Me.DW.ItemsSelected(0))
or this ?
strlist = Me.DW.Column(1, Me.DW.ItemsSelected(1))

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thankyou, yes that works for me perfectly. Have a good weekend
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top