Clearing A ListBox?

J

Joe Delphi

Anyone know how to clear the items in a ListBox?

I was hoping for something like ListBox.Clear but there doesn't appear to be
any such method.


JD
 
J

Joe Delphi

tembel said:
Subject: RE: Clearing A ListBox?

Isn't it like clearing a listbox in Delphi?

Not as far as I can tell from the MS Access Help files. In Delphi, the
ListBox has a .Clear method that allows you to clear all items in the list
at one time. Since MS Access does not offer this command, I was wondering
how other programmers handle this situation.

I know that there is a ListBox.RemoveItem method, but removing things one
item at a time seems sort of klutzy to me.

JD
 
R

RoyVidar

Joe Delphi wrote in message said:
Not as far as I can tell from the MS Access Help files. In Delphi, the
ListBox has a .Clear method that allows you to clear all items in the list
at one time. Since MS Access does not offer this command, I was wondering
how other programmers handle this situation.

I know that there is a ListBox.RemoveItem method, but removing things one
item at a time seems sort of klutzy to me.

JD

For a value list rowsource, you could set the rowsource to vbNullString
(a k a "").

me!lstMyList.rowsource=vbnullstring
 
R

Ricky Hicks MVP

Do you want to simply unselect all items selected within the listbox ???

R. Hicks
 
Top