Private Sub delBtn_Click()
rs.Open
Dim list As ListItem
Set list = ListView1.ListItems.Add(, CStr(rs!Project_Name))
confirm = MsgBox("Do you want to delete the Employee Record", vbYesNo + vbCritical, "Deletion Confirmation")

       If confirm = vbYes Then
        ListView1.ListItems.Remove ListView1.SelectedItem.Key  'this line gives error
      Dim CM As ADODB.Command
      Set CM = New ADODB.Command
      Set CM.ActiveConnection = con
      CM.CommandType = adCmdText
      CM.CommandText = "DELETE FROM bmsTable WHERE Project_Name= ?"
      CM.Parameters.Append CM.CreateParameter("@Name", adVarChar, adParamInput, 50, ListView1.SelectedItem.Key)
      CM.Execute , , adExecuteNoRecords
      MsgBox "Record successfully deleted..", vbInformation, "Success"
    End If
    End Sub

Be sure to test this on XP SP3 to be sure it's not one of those issues you encounter on say Windows 10.

PS. What is that key value? https://www.google.com/search?q=Q204054 may shed light that it's "by design."

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.