Okay, to split on the comma (,) you need to use...
THE Split Function!
Dim MyArray() As String
MyArray = Split(lstData.List(i), ",")
txtID.Text = MyArray(0)
txtName.Text = MyArray(1)
txtAge.Text = MyArray(2)
Then would it not be lstData.RemoveItem(i)?
And now for why you are having so many problems...
Tools>Options>Put a check next to Require Variable Declaration>OK
In future projects this will put Option Explicit at the top of all your forms and modules and will make you declare your variables. This will solve a lot of problems for you. In fact, you could manually put it in at the top of your existing forms and modules and this will help you out by pointing out your mistakes.
Good Luck
Reputation Points: 156
Solved Threads: 296
Posting Virtuoso
Offline 1,670 posts
since Mar 2009