Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi Select List Box Clear Selections 3

Status
Not open for further replies.

jmeadows7

IS-IT--Management
Jun 13, 2001
148
0
0
US
I have a list box from which I allow a user to select multiple rows. One action that the user is allowed to do once the selections are made is to delete the underlying data.

All of this works fine except that after I requery the list box, the lit box rows are still highlighted as selected and it seems as if the .ItemsSelected collection is still populated with the same number of rows.
Note: The data is deleted correctly and is not displayed after the requery.

Question:
How can I clear the selection and the ItemsSelected collection so that it does not mess up future user actions.

Thanks,
 
Try:

[tt]me!lstList.rowsource=me!lstList.rowsource[/tt]

Roy-Vidar
 
What SAVE!!
Thanks for the help - have a STAR!
 
Thanks RoyVidar! This solves half of my problem. The other half... Is there a way to select all items in the box with a button click?
 
Yup, something like this, perhaps:

[tt]dim lngCounter as long
for lngCounter = 0 to me!lstList.listcount-1
me!lstList.selected(lngCounter) = true
next lngCounter[/tt]

Roy-Vidar
 
YOU DA MAN!
Just what I needed! Thank you very much! You deserve another star!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top