select all feature

teel73

Registered User.
Local time
Today, 13:56
Joined
Jun 26, 2007
Messages
205
Hi everyone. I am trying to create a "select all feature" for my multi select listbox. Basically if I have 10 items in the list, instead of the user selecting each item or selecting the first item and then holding down the shift key and selecting the last item, I want them to be able to click a button that will select all the items in the list for them. Is that possible?
 
Sure, but depending on how you're coding the next step, it might be simpler to handle it there. Generally, if you want them all, you simply don't add that field to your criteria. In any case:

Code:
  Dim ctl           As Control
  Dim i             As Integer

  Set ctl = Me.lstCharges

  For i = 0 To ctl.ListCount - 1
    ctl.Selected(i) = True
  Next i
 
Here is a list box demo that covers the feature you were asking about

David
 

Attachments

Users who are viewing this thread

Back
Top Bottom