Hej!Listview skriver samma rad
Min listview loopar inte igenom varje rad, utan den skriver första raden hela tiden
<code>
For Each ListItem In ListView1.ListItems
If ListItem.Text = "KD" Then Transtype = 0
If ListItem.Text = "KÖ" Then Transtype = 1
If ListItem.Text = "UT" Then Transtype = 2
tmpAmount = Format(ListView1.SelectedItem.SubItems(4), "#####0.00")
tmpAmount = Replace(tmpAmount, ",", ".")
tmpVat = Format(ListView1.SelectedItem.SubItems(5), "#####0.00")
tmpVat = Replace(tmpAmount, ",", ".")
SQL = "INSERT INTO tblTransdata (transid,ID,transtype,transdate,xvalue,Bonus,amount,Vat,xNotes) " & _
" VALUES " & _
"(" & tmpTransId & "," & ID & "," & Transtype & ",'" & ListView1.SelectedItem.SubItems(1) & "'," & _
"" & ListView1.SelectedItem.SubItems(2) & "," & ListView1.SelectedItem.SubItems(3) & "," & _
"" & Trim$(tmpAmount) & ", " & Trim(tmpVat) & ",'" & ListView1.SelectedItem.SubItems(6) & "')"
Set Rst = Con.Execute(SQL)
Set Rst = Nothing
Next
</code>
är det någon som kan se varför
/Tyronne