Bob
Whilst I agree with the theory here - in practice it is a little more complicated than that. In addition, IIF statements seem more forgiving when they encounter NULL Values in the parameter list. (as it is I have had to Nz prefix each param. passed to the function).
The primary problem I am having with this arrangement is this : I have an instance where - if I pass a single parameter to the function call - the correct result is returned ie.
GetCurrentStockValue (Nz[UnitPrice],0)
However, if I attempt to call the function with the whole list of parameters (I need to account for all types/instances of stock items) :
GetCurrentStockValue([StockIdentifier],Nz([SupplierId],0),Nz([Unit_Dia],0),Nz([UnitPrice],0),Nz([Unit_Con],0),Nz([Weld_ID],0),Nz([Weld_OD],0),Nz([CentreDia],0),Nz([CentreThk],0),Nz([ConsPerPk],0))
The very same record returns with 'Error' in the calculated column.
To try and identify the reason for this I have even re-defined the function body to simply return the UnitPrice value :
GetCurrentStockValue = sngPrice
But the same error value results.....?
Do you have any ideas why this could be happening?