hey guys i need some a litle help with my vb.
i have a problem with my project
i cant delete a data in a file and i cant split the name,age and id if ever i click it, it will display above of it in FRMRETRIEVE
i have here all my code in the zip file
Private Sub cmdDelete_Click() // IHAVE ALSO PROBLEM
Dim i As Integer //WITH THIS DELETE
If rey.Text(lstData.List) = "true " Then //IT WILL NOT DELETE
If MsgBox("You want to delete this data" & rey.Text) Then
rey.RemoveItem (lstData.ListIndex)
Close #1
End If
End If
End Sub
Private Sub cmdRetrieve_Click()
Dim X As String
Open App.Path & "\rey.txt" For Input As #1
While Not EOF(1)
Line Input #1, X
lstData.AddItem (X)
Wend
Close 1
End Sub
Private Sub cmdSave_Click()
Dim i As Integer
i = lstData.ListIndex
lstData.List(i) = txtID.Text
lstData.List(i) = txtName.Text
lstData.List(i) = txtAge.Text
Open App.Path & "\rey.txt" For Output As #1
For i = 0 To lstData.ListCount - 1
Print #1, lstData.List(i)
Next i
Close 1
End Sub
Private Sub lstData_Click() // I HAVE A PROBLEM WITH THIS AREA
Dim i As Integer //IT WILL NOT SPLIT
//THE AGE,NAME & id
i = lstData.ListIndex // IF I WILL CLICK THE LISTDATA
txtID.Text = lstData.List(i) // IT WILL BE SPLIT IN THE ABOVE
txtName.Text = lstData.List(i)
txtAge.Text = lstData.List(i)
End Sub