| | |
Subtracting from database
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: 814
Reputation:
Solved Threads: 148
0
#2 30 Days Ago
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: 243
Reputation:
Solved Threads: 35
1
#3 29 Days Ago
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 27 Days Ago
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; 27 Days Ago 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 |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college 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 save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





