Designing new form from existing sample

D

decoderman

Hi,

I am very new to infopath. I am trying to design a form from an existing
sample; the Invoice (Single Tax Rate) sample to be exact.

The sample form comes pre-set with a repeating table. That repeating table
has such items as quantity, unit price and discount rate, which are
calculated and displayed in a Pre-tax Total Price field once the values are
input into the required fields that generate it. I am trying to add another
field to this repeating table, called 'Flat Discount Rate'. This field is an
alternative to a % discount in the situation that a whole dollar amount needs
to be discounted from the calculated Pre-tax Total Price.

I am able to add the field to the form layout and tie the field to a
datasource I create "flatDiscRate". I also am able to modify the layout to
place the field where I want it to be.

My problem comes in when I want to tie this new value into the calculation
of the Pre-tax Total Price field. I have looked everywhere, but I am unable
to find the underlying function script doing the calculations for the
existing items. Logically, I would think the script would be inside of the
field tied to the Pre-tax Total Price, but it is not, as far as I can see.
Are the function scripts that exist in the default fields of the existing
sample form hidden somehow? I just need to tie my new field into the existing
calculation, but I cannot find the existing calculations.

Any help would be greatly appreciated!!!
 
S

S.Y.M. Wong-A-Ton

Go to Tools > Programming > Microsoft Script Editor. Once in the editor, look
for a function called "calcTotals". This performs the calculations.
 
Top