CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 CALC in EVENTS

Print topic Send  topic

Author Message
Marco
Posted: 05/02/2002, 8:20 AM

I am using asp + access

In the begore Update / Before Insert event I would like to make a calc based on input fields and saved in a calc field. What is wrong?

fldCALC01 = (fldINPUT1-fldINPUT2)/fldINPUT1

--

(fldINPUT1-fldINPUT2) is working but the /fldINPUT1 is not working????

Any suggestions?

Marco
Ken Hardwick
Posted: 05/02/2002, 9:17 AM

Marco,

Since one can not declare a variable type in ASP..I normally try to
force my variables in a type esp. when doing calculations..

ie...do something like...and I also try to avoid dividing by zero
by adding an if statement checking for when divider = zero....

fldINPUT1 = clng(fldINPUT1)*1
fldINPUT2 = clng(fldINPUT2)*1

if fldINPUT1 <> 0 then
fldCALC01 = (fldINPUT1-fldINPUT2)/fldINPUT1
else
fldCalc01 = 0
end if


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.