Quick way to remove selections in listboxes?

M

mscertified

My form has eight listboxes, is there a quick way to remove all current
selections in all of them (without traversing .ItemSelected colllections)?

Thanks.
 
D

Dirk Goldgar

In
mscertified said:
My form has eight listboxes, is there a quick way to remove all
current selections in all of them (without traversing .ItemSelected
colllections)?

I would use the ItemsSelected collection -- that would be most
efficient, execution-wise. However, if there's some reason you don't
want to do that, you could just reassign the rowsource of each list box.
As in:

For Each ctl In Me.Controls
If ctl.ControlType = acListBox Then
ctl.RowSource = ctl.RowSource
End If
Next ctl
 
Top