Wrox Programmer Forums
|
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 27th, 2008, 06:36 AM
Registered User
 
Join Date: Nov 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.







Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding ComboBox inside ListView problem gunnjamie Windows Presentation Foundation 1 July 17th, 2008 02:13 PM
problem writing listview data to mysql db method Pro VB 6 2 April 10th, 2007 07:17 PM
problem selecting listview item method Visual C++ 0 July 7th, 2006 04:06 PM
problem writing listview data to mysql db method Pro VB Databases 0 May 17th, 2006 06:18 AM
Problem with Populating ListView Brian_Leigh65 VB Databases Basics 3 August 2nd, 2004 08:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.