Sub Form Calculations

Sub Form Calculations

Hay ,

i have one form(Product Form) in which Sub form comes first with fields:-
Product Name       (Drop down Field From Diff Form)
Price                     (Currency Field)
Tax                        (Drop Down Field From Diff Form)
Total                      (Currency Field)

Under Sub form other fields are:-
SubTotal          (Currency Field)
Price15%         (Currency Field)
Price18 %        (Currency Field)
AP15%            (Currency Field)
AP18% (Currency Field)
Total Elu          (Currency Field)

eg if i enter values:-
product Name       price          Tax                total
       A                   1000         15%-In           850
       B                   1000         15%-In           850
       C                   1000         18%-En         820
       D                   1000         18%-En         820

SubTotal =   3340
Price15% =   1700          Total of All rows with 15% tax -In            (850+850)
Price18% =   1640          Total of All rows with 18 % tax -En          (820+820)
Ap15% =      255             input.Price15%   * 15 / 100                     (1700*15/100=255)
AP18% =      295.2          input.Price18%   * 18 / 100                     (1640*18/100=295.2)
Total Elu =  2789.8          input.SubTotal-(input.Ap15% + Ap18%)  (3340-(255+295.2)=2789.8)

How to get values of  Price15% & Price18%  ??

Any Help/Assistance can provide would be greatly appreciated.Thank you in Advance.