| | |
Subtracting from database
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Oct 2009
Posts: 3
Reputation:
Solved Threads: 0
Hello it's me again i'm having problem with the database subtraction for my POS Project im using ado database and i know that you just have to change the value from the selected and voila it would update the database but mine doesnt work:
' txtqan is connect to the item database
txtqan.text = Val(txtqan.text) - Val(txtsalesqan.text)
' txtqan is connect to the item database
txtqan.text = Val(txtqan.text) - Val(txtsalesqan.text)
•
•
Join Date: Mar 2009
Posts: 893
Reputation:
Solved Threads: 167
0
#2 Oct 30th, 2009
So you are using the ADODC (ActiveX Data Objects Data Control) right???
Good Luck
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
adodc1.Recordset.Update
Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.
Thanks
Thanks
•
•
Join Date: Jan 2008
Posts: 255
Reputation:
Solved Threads: 38
1
#3 Oct 31st, 2009
Try the following -
Hope this solves your problem.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim x as Integer, y as Integer, z as Integer x = Val(txtQan.Text) y = Val(txtSalesQan.Text) z = x - y rsQan!Qauntity = z rsQan.Update 'rsQan is your recordset 'Qauntity is your field name
Hope this solves your problem.
Please mark questions as answered when done.
Be the ONE!!!
Be the ONE!!!
•
•
Join Date: Oct 2009
Posts: 3
Reputation:
Solved Threads: 0
0
#4 Nov 1st, 2009
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
1. Dim x as Integer, y as Integer, z as Integer 2. x = Val(txtQan.Text) 3. y = Val(txtSalesQan.Text) 4. z = x - y 5. 6. rsQan!Qauntity = z 7. rsQan.Update 8. 'rsQan is your recordset 9. 'Qauntity is your field name
thx for the help i just change the code a little bit and it work just add .recordset to make it work for my system thx here the new code:
1. Dim x as Integer, y as Integer, z as Integer
2. x = Val(txtQan.Text)
3. y = Val(txtSalesQan.Text)
4. z = x - y
5.
6. rsQan.recordset!Qauntity = z
7. 'rsQan is your recordset
8. 'Qauntity is your field name
Last edited by ivankenny; Nov 1st, 2009 at 7:57 pm.
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: College library system
- Next Thread: visual basic
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





