Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21096

[RESOLVED] how to calculate remaining quantity in the same listview

$
0
0
i got a inventory system with a listview that holds the records from there.
now so far everything worked ok.
i added another value in the DB Called InvSold (SubItems(20)
when i sell something in the cashregister i want the InvSold to show me the remaining of the quantity for the same product and not subtract it from
the quantity i just purchased.
lets say i purchased 5 phones and i sell 3 so the InvQuantity will show 5 and the InvSold will show 2
the InvSold will only show the remaining quantity ant nothing else.
this are the values of the Inventory.
Code:

Table Name - Inventory
InvID - Long
InvDate - Date/Time
InvItem - Text
InvQuantity - Currency
InvBeforeTax - Currency
InvInvoice - Text
InvSupplier - Text
InvEmail - Text
InvPhone - Text
InvBranch - Text
InvFax - Text
InvCompany - Text
InvPaymentMethod - Text
InvPayments - Text
InvParts - Text
InvExpire - Date/Time
InvTax -  Currency
InvAfterTax - Currency
InvForCust -Text
InvTotal - Currency
InvPhoto - Text
InvRemarks - Text
InvSold - Currency

and this is the code that i subtract from the inventory(Quantity) From FrmCashRegister
Code:

strSQL = "UPDATE Inventory SET InvQuantity = InvQuantity - " & Txt(6).text & " WHERE InvParts = '" & RplS(Txt(5).text) & "'"
if any information is needed i will add

Viewing all articles
Browse latest Browse all 21096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>