Grid Calculation

reddy_srg

Member
Hi Friends ,

I have grid on which user enter the records/rows .....The Format of grid is

Salesman Date ProductLine SplitRate

1 08/29/2006 1000 20

2 08/30/2006 2000 80

3 08/31/2006 1000 60

4 09/1/2006 1000 10

5 10/20/2006 2000 20

6 10/20/2006 3000 100

7 9/20/2006 1000 40


so Here i needed to calculate the total based on Productline and when ever the Split rate on that product line < or > 100 i have to show error .....this should be done on OK button .....if there is solution based on grid line ...then i am also looking for it.

Can anyone pls let me know thw solution.

Thanks,

Reddy
 

Attachments

  • 110989-Problem.txt
    586 bytes · Views: 104
Hi Reddy.
I would try next solution:
Create global variable which will store ProductLine totals (f.e. frm_PrLine_Total) Initialise it with zero. Next, on "Col Is Exited" event (in ProductLine column) calculate new total ProductLine value (frm_PrLine_Total = frm_PrLine_Total + GC ProductLine). On first OK pressing add two empty rows at the end of the grid - first for other user records, second for total ProductLine value. On other OK pressing just add only one empty row, cause total line already written.
Check SplitRate value on "Col Is Exited" event (in SplitRate column). If it is incorrect raise your own error msg, or show Message Form with warning. Or just change SplitRate field color to red.
Hope this helps.
 
Back
Top