This topic is locked

modify calculated field before update

10/7/2009 10:38:00 AM
ASPRunner.NET General questions
I
itmgr@maxitrol.com author

I need to update a calculated field to store the sales tax of a taxable item. I have a checkbox field (taxable). If it is checked the unittax field should be .06quantityunitprice. Otherwise the unittax field should be zero.
I have tried this and many other variations without success. In the Before record update of the edit page:



dim istax as string

istax= e["taxable"].tostring()
if istax <> db.null then

e["unittax"]=.06*e["unitprice"]*e["quantity"]

else

e["unittax"]=0

end if



Can anyone indicate the correct syntax.

Thanks in advance.

Sergey Kornilov admin 10/16/2009

Try the following:

Dim istax As String

istax = e("taxable").ToString()
If istax <> Nothing Then

e("unittax") = 0.06 * e("unitprice") * e("quantity")

Else

e("unittax") = 0

End If


If this doesn't help post your application to Demo Account (use 'Demo Account' button on the last screen in program). Then open a ticket at http://support.xlinesoft.com sending your Demo Account URL for investigation.