access thread: Unselecting from list box
Message #1 by "isha" <ishasingh74@y...> on Thu, 6 Dec 2001 21:42:03
|
|
I have a multiselect listbox on my form.
when the user clicks on clear command button
i want unselect all the previously selected
items from the list box....
how can i do it?
Message #2 by "isha" <ishasingh74@y...> on Thu, 6 Dec 2001 21:44:46
|
|
How can I unselect all the selected items in the list box...
say on the click of CLEAR button...i want to give user a
fresh list box...
Message #3 by brian.skelton@b... on Thu, 6 Dec 2001 22:19:01
|
|
This little function does the trick:
Public Function UnselectListbox(lbToClear As ListBox) As Boolean
'--------------------------------------------------------
'Unselect all lines in the lbToClear listbox and set it's value to NULL
'--------------------------------------------------------
Dim varItem As Variant
For Each varItem In lbToClear.ItemsSelected
lbToClear.Selected(varItem) = False
Next varItem
lbToClear = Null
End Function
-Brian
> How can I unselect all the selected items in the list box...
> say on the click of CLEAR button...i want to give user a
> fresh list box...
Message #4 by "isha" <ishasingh74@y...> on Fri, 7 Dec 2001 12:55:50
|
|
Brian! THANK U SO MUCH....it did work
> This little function does the trick:
>
> Public Function UnselectListbox(lbToClear As ListBox) As Boolean
> '--------------------------------------------------------
> 'Unselect all lines in the lbToClear listbox and set it's value to NULL
> '--------------------------------------------------------
> Dim varItem As Variant
>
> For Each varItem In lbToClear.ItemsSelected
> lbToClear.Selected(varItem) = False
> Next varItem
>
> lbToClear = Null
>
> End Function
>
> -Brian
>
> > How can I unselect all the selected items in the list box...
> > say on the click of CLEAR button...i want to give user a
> > fresh list box...
|