Highlighted

i need an arithmetical function !

Avatar

Guest

29-10-2008

hi,



i'd like to insert the following function :



*if "Amount" is inferior to 10, then result is 50.

*if "Amount" is superior to 11 and inferior to 30, then result is 75.

...



Is it possible ?



Thanks a lot for your help !



Alex.

Replies

Highlighted

Avatar

Guest

29-10-2008

Alex



Suppoe you have to text fields on your form named as "Amount" and "Result" respectively. You can write the following script (FormCalc) in the "exit' event of "Amount" text field (the first line of the code is for your reference only, do not include it while psting the code):



form1.#subform[0].Amount::exit - (FormCalc, client)

if (form1.#subform[0].Amount.rawValue < 10) then

form1.#subform[0].Result.rawValue = 50

elseif (form1.#subform[0].Amount.rawValue > 11 and form1.#subform[0].Amount.rawValue < 30) then

form1.#subform[0].Result.rawValue = 75

endif



In case of any queries, please feel free to contact me.

Thanks.



Syed Hussain Itiba Naqvi
Highlighted

Avatar

Guest

30-10-2008

Thanks a lot, the function is ok !



It didn't work but i've just replace "exit" by "calculate" and now it's ok !



Thanks.

Alex