|
-
Apr 22nd, 2008, 01:54 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] [02/03] update problem
hi guys i have this prob to update the table
to update i am doing this
Code:
For i = 0 To a4PrdCode.GetUpperBound(0) - 1
mCmd = "Update BillList Set AmtPaid = AmtPaid - a4Amount(i), Bal = BillAmt - AmtPaid WHERE PRd_Code = '" & a4PrdCode(i) & "' AND = BillNo = '" & a4BillNo(i) & "' AND Ref = '" & a4Ref(i) & "' AND Code = '" & a4Code(i) & "'"
Dim cmd3 As New OleDbCommand(mCmd, MyConConnection)
cmd3.ExecuteNonQuery()
Next
what i want to do is update the amtpaid in the billlist table with the previous amtpaid - the current amt. paid...and so on...can someone guide me how to do that...coz it gives me an error...
what i have to do is to first use a datareader and take the value of amtpaid in a variable and then use the variable - a4amount(i) to replace it by using the parameters....i am sure there would b a way to do it without the need of getting the value of amtpaid in a variable....
i hope i am making myself clear....
thankx a lot for all the help extended to me by this forum members....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|