ExpExchHelp
asked on
Unselect values from listbox(es)
I use a several (unbound) listboxes on a form (for filtering records).
I'd like to include a "Clear Filter" cmdButton that will UNSELECT all select values (not rowsource) in the listboxes. Pls keep in mind that my listboxes are Multi-Select = "Expanded".
The code "Me.lstCTM.RowSource = Null" did not work.
EEH
I'd like to include a "Clear Filter" cmdButton that will UNSELECT all select values (not rowsource) in the listboxes. Pls keep in mind that my listboxes are Multi-Select = "Expanded".
The code "Me.lstCTM.RowSource = Null" did not work.
EEH
ASKER
Capricorn,
thanks, that works great. Is there a way to unselect several listboxes within one statement? Or do I need to create a loop for each listbox?
EEH
thanks, that works great. Is there a way to unselect several listboxes within one statement? Or do I need to create a loop for each listbox?
EEH
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That works perfect!!!
Thanks so much,
EEH
Thanks so much,
EEH
What about just putting nothing in the control:
Me.lstCTM = ""
PS
Me.lstCTM = ""
PS
PissingSkunk,
did you ever tried that before posting?
did you ever tried that before posting?
Yes, but you obviously not before commenting....
Works for me in A97, A200, A2002 and A2007.
Give it a try and report the results :-)
PS
Works for me in A97, A200, A2002 and A2007.
Give it a try and report the results :-)
PS
how do you think that the code you posted will *unselect* selected items from a list box?
How do you think that it doesn't ?
PS
PS
Ping...
Took the time to test ?
PS
Took the time to test ?
PS
And ?
PS
PS
sub ClearListBox()
dim j
with me.listboxName
for each j in .itemsselected
.selected(j)=false
next
end with
end sub