VB2005 Listview problem
I am writing an application to view an selected fields from an ADO recordset using a Listview Control. When the project opens the full list is populated (some 800 records) and appears OK.
I have added a combobox control to filter the recordset (in effect rebuild it) and then display the contents of the updated recordset in the same listview control.
When rebuilding the listview control I get the following error:
InvalidArgument=Value of '1' is not valid for 'index'.
Parameter name: index
at the line:-
lItem = ListView1.Items.Add(rsTrainee.Fields.Item("Refnum" ).Value)
This occurs when adding the second item in the recordset to the listview. If the recordset only contains one record the list rebuilds fine.
Any thoughts or pointers on how to work around this would be very appreciated.
Thanks,
Jerry.
|