I believe the number of rows in Listboxes starts at 0, not 1.
However, if you're trying to remove all rows, it's simpler strictly to reset
the control's RowSource to a zero-length string:
lstResult.RowSource = ""
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"Gus Chuch" <(E-Mail Removed)> wrote in message
news:0260A658-6CDF-461D-8E2E-(E-Mail Removed)...
> I'm having trouble using the RemoveItem on my ListBox, does anyone know a
> better way?
> I'm using a ListBox to display the results of a loan program. This sets up
> the header
> lstResult.ColumCount = 4
> lstResult.ColumnHeads = True
> lstResult.ColumnWidths = ".5in;1in;1in;1in"
> lstResult.AddItem "Mo;Interest;Principal;Balance"
>
> This Adds Items to the ListBox and it work fine
>
> FOR X=1 to Y
> lstResult.AddItem (MonthNumber & ";" & MonthlyInterest & ";" &
> PrincipalPaid
> & ";" & RemainigBalance)
> NEXT
>
> Now I need to clear the ListBox to run the program again
> So using ListIndex and RemoveItem I try to clear the ListBox but
> All combination that I have tried so far leaves the last row in the header
> row.
> Is their some way of deleting all the Items?
>
> --
> thank You