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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding "ALL" to multiselect listbox

Status
Not open for further replies.

aliendan

Programmer
Jun 28, 2000
79
US
I know I've seen this code somewhere quit awhile back and I can't find it anywhere. Does anyone out there know how to do this? Or is there code you can attach to a button that will select all that is in a multiselect list box? There's got to be a way to do this with out the combination of mouse clicking and shift key.
Dan Rogotzke
Dan_Rogotzke@oxy.com
 
You could define a select all button and on the on click event use the following code:


Private Sub CommandButton_Click()
Dim i As Integer: i = 0
For i = Me.ListBox.ListCount To 0 Step -1
Me.ListBox.Selected(i) = True
Next
End Sub
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Holly cow! Answers to both questions in less than 30 minutes!!! Thank you both so very much...that was IT! I know it was out there somewhere. [thumbsup2]
Dan Rogotzke
Dan_Rogotzke@oxy.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top