Right...this is dead easy. I didn't read this thread yesterday as I thought someone would have already answered it:
WoooofVB Code:
Private Sub cmdDelete_Click() Dim adoConn As Connection Dim lvwItem As ListItem Dim strSQL As String Set lvwItem = ListView1.SelectedItem If Not (lvwItem Is Nothing) Then Set adoConn = New Connection adoConn.Open CONN_STRING strSQL = "DELETE * FROM TABLE WHERE ID = " & lvwItem.SubItems(1) adoConn.Execute strSQL ListView1.ListItems.Remove lvwItem.Index Set lvwItem = Nothing adoConn.Close Set adoConn = Nothing End If End Sub




Reply With Quote