ListBox Select all

B

Bret

Please..
I have a listbox in a form with about 100 records with
the multiselect feature activated.
I want to add a button that selects all records in the
listbox. What would the code be for this?

thank you. thank you!
 
D

Dan Artuso

Hi,

Dim i As Integer
For i = 0 To Me.List0.ListCount - 1
Me.List0.Selected(i) = True
Next i

Just substitute the name of your listbox.

HTH
Dan Artuso, MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top