Quick way to remove selections in listboxes?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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

Thanks.
 
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
 
Back
Top