Help please. Here's my table.
ID Item Qty Added Qty
1 Ballpen 23 5
2 Pencil 44 4
3 Pentelpen 12 5
I want to update the items once, but when I run my program it becomes the same as the first item.
For example when click the save button, all item qty will be 28 like ballpen.
Here's my code. Thanks in advance.
Dim lvitem As Object
Dim iCount As Integer
Dim iLoop As Integer
Dim qty As Double = Val(lvPO.Items(0).SubItems(1).Text) + Val(lvPO.Items(0).SubItems(2).Text)
iCount = lvPO.Items.Count()
If Not lvPO.Items.Count = 0 Then
Do Until iLoop = lvPO.Items.Count
lvitem = lvPO.Items.Item(iLoop)
With lvitem
Call SEDCommand("E", "tbl_item", " qty = '" & qty & "' WHERE itemid ='" & .SubItems(0).text & "'")
End With
iLoop = iLoop + 1
lvitem = Nothing
Loop
MsgBox("Purchase Order (" & tb_refpo.Text & ") is added in database!", MsgBoxStyle.Information, "SYSTEM")
ClearTextBox(Me)
End If
qty, and it does that using the first item.