Connecting Tech Pros Worldwide Forums | Help | Site Map

Clearing multi-select list

John
Guest
 
Posts: n/a
#1: Jul 16 '06
Hi

How can I clear the selection from a multi-select list via code?

Thanks

Regards





Allen Browne
Guest
 
Posts: n/a
#2: Jul 16 '06

re: Clearing multi-select list


See the ClearList() function at:
http://allenbrowne.com/func-12.html

Works for both normal and multi-select list box.

(There's also a function to select all.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"John" <John@nospam.infovis.co.ukwrote in message
news:V9mdnboEs_T0NyTZnZ2dnUVZ8tOdnZ2d@pipex.net...
Quote:
>
How can I clear the selection from a multi-select list via code?

Rich P
Guest
 
Posts: n/a
#3: Jul 17 '06

re: Clearing multi-select list


Hi John,

Try something like this out:

Private Sub Command9_Click()
Dim i As Integer
For i = 0 To List7.ListCount
List7.Selected(i) = False
Next
End Sub

This will loop through all the items in a listbox and just set everthing
to selected = false.


Rich

*** Sent via Developersdex http://www.developersdex.com ***
Closed Thread