1. You did not need to open recordset to delete records - all you had to to do was execute sql via connection (or command object):
cnn.Execute "delete..."
2. You need to build sql string:
Note: use Replace(List1.List(LIst1.ListIndex), "'", "''") instead in case if any of listitems contain single quote character.Code:Dim strSQL As String strSQL = "DELETE FROM customers WHERE FirstName='" & List1.List(LIst1.ListIndex) & "'"




Reply With Quote