Answered by:
How to deduct sold item from quantity in access database using VB6.0

Question
-
i am working on my final year project. point of sale. i want the stock to be updated each time an item is sold by deducting sold from quantity in database. Am using Access Database. it has four fields, ProductID, Proudctname productquantity, product price.
- Moved by Mike Feng Friday, March 1, 2013 9:08 AM
Thursday, February 28, 2013 9:25 AM
Answers
-
Two points.
1 Without knowing just how you are doing things it is impossible to suggest any thing other than update the appropriate record. Some idea of the tables and code would be helpful.
2 This is the wrong forum for VB6 and it is considered obsolete. Why are you still using VB6?
Regards David R
---------------------------------------------------------------
The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones.
Object-oriented programming offers a sustainable way to write spaghetti code. - Paul Graham.
Every program eventually becomes rococo, and then rubble. - Alan Perlis
The only valid measurement of code quality: WTFs/minute.- Proposed as answer by Cor Ligthert Thursday, February 28, 2013 10:25 AM
- Marked as answer by Just Karl Wednesday, November 13, 2013 4:52 PM
Thursday, February 28, 2013 9:40 AM -
You can post VB 6.0 questions to the below forums. This forum is for Visual Basic .NET.
http://vbcity.com/forums/default.aspx?GroupID=11
http://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier
Paul ~~~~ Microsoft MVP (Visual Basic)
- Marked as answer by Just Karl Wednesday, November 13, 2013 4:52 PM
Thursday, February 28, 2013 1:44 PM
All replies
-
Two points.
1 Without knowing just how you are doing things it is impossible to suggest any thing other than update the appropriate record. Some idea of the tables and code would be helpful.
2 This is the wrong forum for VB6 and it is considered obsolete. Why are you still using VB6?
Regards David R
---------------------------------------------------------------
The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones.
Object-oriented programming offers a sustainable way to write spaghetti code. - Paul Graham.
Every program eventually becomes rococo, and then rubble. - Alan Perlis
The only valid measurement of code quality: WTFs/minute.- Proposed as answer by Cor Ligthert Thursday, February 28, 2013 10:25 AM
- Marked as answer by Just Karl Wednesday, November 13, 2013 4:52 PM
Thursday, February 28, 2013 9:40 AM -
here is part of the code..
[code]
Private Sub cmdsave_Click()
Dim sql As String
For i = 0 To List1.ListCount
rstRecordSet.Open "INSERT INTO Salesrecord VALUES ('" & List1.List(i) & "', '" & List2.List(i) & "', '" & List3.List(i) & "','" & List4.List(i) & "','" & Text1.Text & "')"
Next i
MsgBox ("Record Added")
sql = "update Stock set productquantity = productquantity -" & txtqty.text & " where id = 'F0001'"""
sql = "UPDATE Stock SET Productquantity = me.productquantity - " & txtqty.Text & " WHERE ProductID = 'F0002 '"
'If productQuantity <= 15 Then
'MsgBox ("Stock Level is Low")
conconnection.execute sql
end sub [end/code]
Thursday, February 28, 2013 11:03 AM -
You can post VB 6.0 questions to the below forums. This forum is for Visual Basic .NET.
http://vbcity.com/forums/default.aspx?GroupID=11
http://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier
Paul ~~~~ Microsoft MVP (Visual Basic)
- Marked as answer by Just Karl Wednesday, November 13, 2013 4:52 PM
Thursday, February 28, 2013 1:44 PM -
YES!!!!!
Renee
"MODERN PROGRAMMING is deficient in elementary ways BECAUSE of problems INTRODUCED by MODERN PROGRAMMING." Me
Thursday, February 28, 2013 2:21 PM