hello Guys,, I am Developing POS and I have A Code To Add An item into Listview Then Exactly Work.. Then My Problem is, what if the Customer Select two Similar Item let Say 3 Pack of Milk and 2 Sardines..
Example:
Item--------------QTy
Milk--------------- 1
Sardines---------- 2
I forgot to add 2 pack of milk, Then I want to become like this
Example:
Item--------------QTy
Milk--------------- 1
Sardines---------- 2
Milk--------------- 2..
But in My code this is What happen
Item--------------QTy
Milk--------------- 3
Sardines---------- 2
Its Updated the QTy Instead Make A another Row.
HElo Guys,, This is My code..
Code:Dim qtyadd As String Dim subtotaladd As String Dim itm As MSComctlLib.ListItem Dim i As Integer Set itm = ListView1.FindItem(txtCode.Text) If Not itm Is Nothing Then itm.EnsureVisible itm.Selected = True qtyadd = Val(txtqty.Text) + Val(ListView1.SelectedItem.SubItems(2)) subtotaladd = Val(lbltotal.Text) + Val(ListView1.SelectedItem.SubItems(4)) ListView1.SelectedItem.SubItems(2) = qtyadd ListView1.SelectedItem.SubItems(4) = Format(subtotaladd, "###################.00") Else ListView1.ListItems.Add , , txtCode.Text ListView1.ListItems.Item(ListView1.ListItems.Count).ListSubItems.Add , , txtproductname.Text ListView1.ListItems.Item(ListView1.ListItems.Count).ListSubItems.Add , , txtqty.Text ListView1.ListItems.Item(ListView1.ListItems.Count).ListSubItems.Add , , txtprice.Text ListView1.ListItems.Item(ListView1.ListItems.Count).ListSubItems.Add , , lbltotal.Text End If


Reply With Quote

Bookmarks