Hi,
I have the following piece of code which is ment to do a
couple of calculations for me, however for some reason
tmprs("disc") returns some strange results.
If I enter a value of 10 for tmprs("disc") it is fine but
if I enter a second value for tmprs("disc") it doubles my
value. E.G. if I enter 20 the result is 2020
Why and how do I fix it???
An example of response.write statement might look like
this:
0
10
2020
Please help!
Thanks
...:: CODE ::..
if not (tmprs.eof and tmprs.bof) then
tmprs.movefirst
totalcost = 0
totaldisc = 0
grandtotal = 0
while not tmprs.eof
response.write (totaldisc)
response.write ("<BR>")
response.write (tmprs("disc"))
totalcost = totalcost + (tmprs("Quantity") * tmprs
("UnitCost"))
totaldisc = (totalcost / 100 * (totaldisc + tmprs
("disc")))
tmprs.movenext
wend
totaltax = ((totalcost-totaldisc)/100) * TaxAmount
grandtotal = (totalcost + totaltax + numchk(rs
("ShipCost")) + numchk(rs("SurCharge"))) - totaldisc
'error correction
On Error Resume Next
usgrandtotal = ((totalcost/exrate) + (totaltax/exrate) +
(numchk(rs("ShipCost")/exrate)) + (numchk(rs
("SurCharge")/exrate))) - (totaldisc/exrate)
If Err.Number <> 0 Then
Else