i want to delete selected record from listview and database, but when i press delete button, it deltes onlye first record of listview not selected record...
here is code...
Private Delte_Click()
Call Mydatacon
Dim rs As adodb.Recordset
Set rs = New adodb.Recordset
rs.Open "SELECT * FROM AAAAA_DEMO", con, adOpenStatic, adLockOptimistic 'WHERE code='listview1.SelectedItem'"
If ListView1.SelectedItem.Index And Not rs.EOF Then
rs.Delete
Else
MsgBox "No Any record Found."
End If
End Sub