I am trying to simply re-use the custom function that is in the Custom Functions Demo.rpt. I have put the following code in a custom function in a new report (named the same thing) and I get a syntax error.
The error is: "A ( is expected here" where here it highlights the function name.
Here is the code:
Function cdFormatCurrencyUsingScaling(value As Currency,
nDecimalPlaces As Number,
thousandsSymbol as String,
millionsSymbol as String) As String
nDecimalPlaces = Round (nDecimalPlaces)
If nDecimalPlaces < 0 Or nDecimalPlaces > 9 Then
nDecimalPlaces = 2
End If
If Abs (value) >= 1000000 Then
cdFormatCurrencyUsingScaling = CStr (value / 1000000, nDecimalPlaces) + millionsSymbol
ElseIf Abs (value) >= 1000 Then
cdFormatCurrencyUsingScaling = CStr (value / 1000, nDecimalPlaces) + thousandsSymbol
Else
cdFormatCurrencyUsingScaling = CStr (value, nDecimalPlaces)
End If
End Function