i wonder if he wants the sum to be calculated after pressing a button (code of kapamarou in OnPush() ) or if he wants to have the sum calculated in realtime during lines selection (not suggested). in the 2nd option, you should try some other form trigger, and review kapamarou code in order to not use "rec" variable but another variable pointing to the same table (to avoid filer problems)
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso My Blog
i wonder if he wants the sum to be calculated after pressing a button (code of kapamarou in OnPush() ) or if he wants to have the sum calculated in realtime during lines selection (not suggested). in the 2nd option, you should try some other form trigger, and review kapamarou code in order to not use "rec" variable but another variable pointing to the same table (to avoid filer problems)
generic Solution is in my mind for the 1st option. But I want to work for the 2nd Option.
Which Trigger should I try ??? :-k :-k
i wonder if he wants the sum to be calculated after pressing a button (code of kapamarou in OnPush() ) or if he wants to have the sum calculated in realtime during lines selection (not suggested). in the 2nd option, you should try some other form trigger, and review kapamarou code in order to not use "rec" variable but another variable pointing to the same table (to avoid filer problems)
generic Solution is in my mind for the 1st option. But I want to work for the 2nd Option.
Which Trigger should I try ??? :-k :-k
BTW Thnx to both :thumbsup:
just try them...they're not a lot (i would bet on onaftergetrecord)...anyway, think carefully before implementing the second option: althought it is cool, it can backfire if (for example) the user select all records...imagine how huge it would be on a million o recs...and maybe the user didn't either want that sum...
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso My Blog
You should try other triggers. What you are trying to achieve is a bit more complicated than the Gen. Journal form (you should look at this to get an idea from the balance text boxes). But as Belias said, this "automatic" option should better be avoided.
You should try other triggers. What you are trying to achieve is a bit more complicated than the Gen. Journal form (you should look at this to get an idea from the balance text boxes). But as Belias said, this "automatic" option should better be avoided.
Suppose I'm using Sales Journal Form where many entries are there. A TextBox will show us the sum calculated on the Basis of Lines Selection. The sum is nothing but the Nos. of Amount fields Total.
Comments
You can add a button and write:
MySumVar := 0;
CurrForm.SETSELECTIONFILTER(Rec);
IF FIND('-') THEN REPEAT
MySumVar += Amount;
UNTIL NEXT = 0;
You cannot use CALCSUMS.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
generic Solution is in my mind for the 1st option. But I want to work for the 2nd Option.
Which Trigger should I try ??? :-k :-k
BTW Thnx to both :thumbsup:
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Suppose I'm using Sales Journal Form where many entries are there. A TextBox will show us the sum calculated on the Basis of Lines Selection. The sum is nothing but the Nos. of Amount fields Total.