I'm having a small issue with a test database I'm building.
I have accounts with a subform called Pmt Data. It's supposed to grab all the values and spit them into DBPd on the main form. I've got some code in there to calculate compound interest, but that can be ignored.
However, I've created some test data with a positive $300, and a negative $300, and it's coming out as $600, rather than $0. What is causing my negative amount to be counted as a positive?
Thanks!
// Give Total Collected
vRecord = 1
vCount = @FormResultSetTotal("Pmt Data")
vPdHere = 0
vPdDir = 0
if vCount >0 then
{
While vRecord <= vCount
{
vPdHere = @TM(vPdHere) + @TM(@FormFieldValue("Pmt Data", "PdHere", vRecord))
vPdHereInt = @TM(vPdHereInt) + @TM(@formfieldvalue("Pmt Data", "PdHere", vRecord)) * @Exp(1+DBIntRate,((@date-(@todate(@formFieldValue("Pmt Data","LE0",vRecord))))/365))
vPdDir = @TM(vPdDir) + @TM(@FormFieldValue("Pmt Data", "PdDir", vRecord))
vPdDirInt = @TM(vPdDirInt) + @TM(@formfieldvalue("Pmt Data", "PdDir", vRecord)) * @Exp(1+DBIntRate,((@date-(@todate(@formFieldValue("Pmt Data","LE0",vRecord))))/365))
vRecord = vRecord + 1
}
DBPd = vPdHere + vPDDir
}