We have customized the Blanket Purchase Order form so that it will show a "Projected Total" on the form which should be a sum of the (lines quantity * quoted cost). This works great as long as only one report is printed at a time. If a range of reports are printed, though, then this value shows the total for all the blanket purchases orders in this field. What do I need to do to get this so that multiple Blanket PO's can be printed at once, but it will only total them individually?
Here is the code I am using to get the Projected Total:
Sub JCMVariables()
Dim row As Integer
Dim Projected As Decimal
Dim Total As Decimal
For row = 0 To ThisForm.PrimaryIDOCollection.GetNumEntries()
If (ThisForm.PrimaryIDOCollection.Items(row).Item("PoType").GetValueOfString("").Equals("B") And
ThisForm.Variables("IncludeBlnsWOReleases").Value = "1") Then
Projected = ((ThisForm.PrimaryIDOCollection.Items(row).Item("ue_JCM_QuoteCost").GetValueOfDecimal(0) * ThisForm.PrimaryIDOCollection.Items(row).Item("QtyOrdered").GetValueOfDecimal(0)))
ThisForm.PrimaryIDOCollection.Items(row).Item("ue_JCM_PJT").SetValue(FormatCurrency(Projected))
Total = Total + Projected
End If
Next
ThisForm.Variables("JCMProjected").Value = FormatCurrency(Total)
End Sub