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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I refresh List box highlighted entries ????

Status
Not open for further replies.

Dylan

MIS
Aug 27, 1998
109
US
I have a list box that is using the MultiSelect propery to allow selecting more than one listed Item.

I also have a button on this form that will print a report based on the items selected in the list box. I would like to code an event that would CLEAR the selected entries from the list box once the command button that prints the reports is exited. Right now it just leaves them highlighted on the form.

thanks for any assistance with this :)


Tom Moran
Lansing, Michigan
 
Try reassign the rowsource:

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

Roy-Vidar
 
Where would that code go ??


Tom Moran
Lansing, Michigan
 
Wherever you'd like - button click, the end of your report code...

Roy-Vidar
 
Hi, Dylan,

As always, Roy's suggestion is right on the mark, but I'll offer an alternative. I assume your code is looping through the ItemsSelected collection - must be, AFAIK that's the only way to get the values from a multi-select listbox. In the loop, you may set the Selected property of the item to False. Something like this:
Code:
For Each Entry in Me!lstMyList.ItemsSelected
    [green]'do some things here[/green]
    Me!lstMyList.Selected(Entry) = False
Next Entry
HTH,

Ken S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top