Hello Guys I need Your Help I have DB and in my database theres a table called Product and Dailyrecord and this is the fields of my table name Product.. (BarCode,ProductName,Quantity,Price) and this is the field of my table name Dailyrecord(Barcode, ProductName, Quantity, Price, SubTotal) this is my code for adding data to list view
Private Sub save()
ListView1.ListItems.Add , , lblrp.Caption
ListView1.ListItems.Item(ListView1.ListItems.Count).ListSubItems.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.Caption
ListView1.ListItems.Item(ListView1.ListItems.Count).ListSubItems.Add , , lbldate.Caption
End Sub
and this is my code for saving data to may dailyrecord
Private Sub savetodailyrecord()
Dim X   As Integer
  Dim SQLString As String

  For X = 1 To ListView1.ListItems.Count
    SQLString = "Insert Into Dailyrecord (Receipt, BarCode, ProductName, Quantity, Price, TotalPrice, purchase_date) Values ('" & ListView1.ListItems(X).Text & "', '" & ListView1.ListItems(X).SubItems(1) & "','" & ListView1.ListItems(X).SubItems(2) & "','" & ListView1.ListItems(X).SubItems(3) & "','" & ListView1.ListItems(X).SubItems(4) & "','" & ListView1.ListItems(X).SubItems(5) & "'," & ListView1.ListItems(X).SubItems(6) & ")"
    acd.Execute SQLString

  Call Purchase

End Sub
and this is what i need to know if i save the data to dailyrecord, the Quantity from dailyrecord is Subtract to the Quantity in Product.. for example in My Listview Quantity You Buy the product name Sardines And in My Stock i have 20 Sardines then You Buy 5 sardines.. and 20-5 = 15 and My Stock Updated to 15 how do i code like this the Output?
this is my code to do that but nothings Happen
Private Sub Purchase()
Dim Counter As Integer
Dim a As Double
Dim supplycounter As Integer ' Goods

  For Counter = 1 To ListView1.ListItems.Count
  If rsProduct.EOF = True Then
  If rsProduct.Fields("BarCode") = ListView1.SelectedItem.SubItems(1) Then
  a = rsProduct.Fields("Quantity")
  Exit Sub
  Counter = a - ListView1.SelectedItem.SubItems(3)
  End If
Call clear
End If
End Sub
help me guys