Mutiselect Listbox

CCIDBMNG

Registered User.
Local time
Today, 09:57
Joined
Jan 25, 2002
Messages
154
I have a listbox set up on my form which lists all of our employees. I also added a "Select All", "Select All Canada" at the top. Is there a way to check which item was selected as soon as the user selects an item. What I want to do is as soon as the user selects "Select All Canada" I want the list box to select all the employees from Canada. I know how to do the second part I'm just not sure how to check what was clicked when it was clicked. Any help would be great.

Thanks in advance.
 
CC,

Code:
'
' Select All ...
'
Dim lngTable As Long
  For lngTable = 0 To Me.lstTables.ListCount - 1
     Me.lstTables.Selected(lngTable) = True
     Next lngTable
'
' How about the item selected/deselected
'
IsChosen = Me.lstTables.Selected(Me.lstTables.ListIndex)
'
' How about the data?
'
varData = Me.lstTables.ItemData(Me.lstTables.ListIndex)
'
' multi-column?
'
varData = Me.lstTables.ItemData(Me.lstTables.ListIndex).column(3)

hth,
Wayne
 
Thanks Wayne that was exactly what I was looking for.
 

Users who are viewing this thread

Back
Top Bottom