Home » Developer & Programmer » Forms » validation of sum of amounts entered
validation of sum of amounts entered [message #362348] Mon, 01 December 2008 23:47 Go to next message
h_jitendras
Messages: 36
Registered: October 2006
Member
hi,
In the form,i have a data-block in which i display the two columns- date and the amount.now i want to perform a validation such that the sum of the amounts entered in that column should not exceed a certain value say $1000.
how do i perform this?

the point where i'm getting stuck is say there are already 2 amounts present and when making a 3rd entry , if their sum exceeds the $1000 value,i should not allow the user to make a entry and fire the validation..i want to achieve this scenario..or may be while saving the changes in the form, i can check the totals and show the error message at that point..

thanks,
Re: validation of sum of amounts entered [message #362374 is a reply to message #362348] Tue, 02 December 2008 01:25 Go to previous messageGo to next message
h_jitendras
Messages: 36
Registered: October 2006
Member
got it..
have an invisible field..and set its property to be a summary field with the summary function as sum and the summarized item as the column(on which you want to perform the validation).
Remember to set the 'Precompute Summaries' in the datablock to Yes..else you will get a compilation error on UNIX box.

thanks everyone...
Re: validation of sum of amounts entered [message #362380 is a reply to message #362348] Tue, 02 December 2008 01:47 Go to previous messageGo to next message
rajy_salim
Messages: 204
Registered: January 2008
Location: Beirut - Lebanon
Senior Member
It's nice you could solve it yourself.

You could use the WHEN-VALIDATE-ITEM trigger if you want to disallow the user leaving the field if your condiation was not respected.

Rajy
Re: validation of sum of amounts entered [message #362559 is a reply to message #362380] Wed, 03 December 2008 00:51 Go to previous messageGo to next message
h_jitendras
Messages: 36
Registered: October 2006
Member
can you suggest some other way to achieve the above requirement?

thanks,
Re: validation of sum of amounts entered [message #362585 is a reply to message #362348] Wed, 03 December 2008 02:13 Go to previous messageGo to next message
rajy_salim
Messages: 204
Registered: January 2008
Location: Beirut - Lebanon
Senior Member
I told you, you can use the WHEN-VALIDATE-ITEM trigger to do your summation and test, but the way you used is pretty much better.

Rajy
Re: validation of sum of amounts entered [message #362622 is a reply to message #362585] Wed, 03 December 2008 05:50 Go to previous message
h_jitendras
Messages: 36
Registered: October 2006
Member
ok.thanks for your time

[Updated on: Wed, 03 December 2008 05:56]

Report message to a moderator

Previous Topic: How to develop software and create an EXE file of my forms?
Next Topic: OLE2 help
Goto Forum:
  


Current Time: Wed Dec 07 06:48:07 CST 2016

Total time taken to generate the page: 0.05772 seconds