That's why I instructed to build a report and call the function from a textbox. Display report in print preview, not report view.
Can have the report RecordSource be a filtered query using the parameters you want.
If you want all products to be on the report, the function will be more complicated. It will need to reset the CumGrowth. Something like:
Code:
Option Compare Database
Option Explicit
Public CumGrowth As Double
Public Product As Integer
Public Function CalcGrowth(dblRet As Double, intProductID As Integer) As Double
If Product <> intProductID Then
Product = intProductID
CumGrowth = 0
End If
CumGrowth = (dblRet + 1) * IIf(CumGrowth = 0, 100000, CumGrowth)
CalcGrowth = CumGrowth
End Function
Then call the function:
=GetGrowth([Return], [ProductID])