M mscertified Jan 2, 2008 #1 Can I just set .ItemsSelected to zero or do I have to loop thru the selections and reset the .Selected property ? Thanks.
Can I just set .ItemsSelected to zero or do I have to loop thru the selections and reset the .Selected property ? Thanks.
D Dirk Goldgar Jan 2, 2008 #2 mscertified said: Can I just set .ItemsSelected to zero or do I have to loop thru the selections and reset the .Selected property ? Click to expand... For a multi-select list box, you need the loop, like this: Dim varI As Variant With Me.lstMyListbox For Each varI In .ItemsSelected .Selected(varI) = False Next varI End With or else you can -- at the cost of rerunning the rowsource query -- reset the list box's rowsource: With Me.lstMyListbox .RowSource = .RowSource End With I would use the former, unless I also need to requery the list box.
mscertified said: Can I just set .ItemsSelected to zero or do I have to loop thru the selections and reset the .Selected property ? Click to expand... For a multi-select list box, you need the loop, like this: Dim varI As Variant With Me.lstMyListbox For Each varI In .ItemsSelected .Selected(varI) = False Next varI End With or else you can -- at the cost of rerunning the rowsource query -- reset the list box's rowsource: With Me.lstMyListbox .RowSource = .RowSource End With I would use the former, unless I also need to requery the list box.