when i save a data from text box it didnt show at the listview
how to do that?
and someone please check my delete coding

Private Sub cmdSave1_Click()
If MsgBox("Are you sure you want to save?", vbYesNo + vbQuestion) = vbYes Then
Set rec = New ADODB.Recordset
rec.Open "Select * From masterclass", Con, adOpenStatic, adLockOptimistic
If check1 Then
rec.Fields!Class = Class
If check22 Then
MsgBox "Your record has been save!", vbOKOnly

Class = ""
Call PopulateList(ListView1, rst)
End If
End If
End If

End Sub

Private Sub PopulateList(pList As ListView, _
pRst As ADODB.Recordset)
On Error Resume Next
Dim i As Long
Dim iColCount As Long
Dim sColName As String
Dim sColValue As String
Dim oCH As ColumnHeader
Dim oLI As ListItem
Dim oSI As ListSubItem
Dim oFld As ADODB.Field

With pList
.View = lvwReport
.GridLines = True
.FullRowSelect = True
.Sorted = False
' set up column headers

For Each oFld In pRst.Fields
sColName = cn(oFld.Name)
Set oCH = .ColumnHeaders.Add()
oCH.Text = sColName
iColCount = iColCount + 1
Next oFld

Do Until pRst.EOF
i = 0
' setup fiprst column as a listitem
sColValue = cn(pRst.Fields(i).Value)
Set oLI = .ListItems.Add()
oLI.Text = sColValue
' add the remaining columns
'as subitems

For i = 1 To iColCount
Set oSI = oLI.ListSubItems.Add()
oSI.Text = cn(pRst(i))
Next ' next column
Loop ' Next record
' refresh it all
' make sure 1st row can be seen
Text1 = ListView1.ListItems.Count
End With

End Sub

Private Sub cmdDlt_Click()
Set tugas = New ADODB.Command
tugas.ActiveConnection = Con
tugas.CommandType = adCmdText
tugas.CommandText = "delete from masterclass where class='" & Class.Text & "'"

End Sub

both...when i save or delete the data it not show at the listview...
please help me

This article has been dead for over six months. Start a new discussion instead.