Hi guys,
I changed my lisbox for Listview . My routines are working except Delete and Search , I got some errors. Can anyone help me with routines Delete and Search ?
Code:Private Sub Command4_Click() 'SEARCH BUTTON Dim i As Long, Lindex As Long If IsArray(a) Then Me.ListView1.ListItems = a Else Me.ListView1.ListItems.Clear End If Lindex = Me.Combo1.ListIndex + 1 If Lindex = 0 Then Exit Sub With Me.ListView1 If .ListItems Then For i = .ListItems - 1 To 0 Step -1 If Val(Split(.List(i, 3), "/")(1)) <> Lindex Then .RemoveItem i Next End If End With End SubSee my project attached.Code:Private Sub DeleteData() ' DELETE DATA Call Pathway(way) 'SET FOLDER WAY Dim i As Long, ii As Long, n As Long, txt As String If Me.ListView1.ListIndex = -1 Then Exit Sub X(Me.ListView1.ListIndex) = Chr(1) X = Filter(X, Chr(2), 0) If UBound(X) > -1 Then txt = Join(X, vbNewLine) Else X = Empty End If Open (way & "\users.txt") For Output As #1 Print #1, txt; Close #1 Call PopulateListview End Sub
listview read txt.zip




Reply With Quote
