empty listbox

P

PeterM

I have a listbox on a form which contains up to 50 items. It gets
repopulated many times. Currently I'm using .RemoveItem to empty the listbox
and then populate it with .AddItem which is time consuming.

I tried setting the listbox .Value to Null which didn't work. Is there a
more efficient way to empty the listbox?

Any help would be appreciated!
 
D

Dirk Goldgar

PeterM said:
I have a listbox on a form which contains up to 50 items. It gets
repopulated many times. Currently I'm using .RemoveItem to empty the
listbox and then populate it with .AddItem which is time consuming.

I tried setting the listbox .Value to Null which didn't work. Is
there a more efficient way to empty the listbox?

Any help would be appreciated!

Have you tried just setting its RowSource property to an empty string ;
e.g.,

Me!lstMyListBox.RowSource = ""

?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top