Possibly more of a vba question, but it is in an Access app - so here goes.
I have a Function with a return type of String.
The function performs a lot of calculation with Double and Currency fields.
If it can't complete the calculation it returns "***" (which is why String is the return type)
But if the sum works then the return line is MyFunc = Round(wOrderLinePrice - (wOrderCost / 100), 2)
where wOrderLinePrice is Double and wOrderCost is Currency.
Now for 4 years this has always worked.(we always made a profit!!!!!) But last week the calculation should have returned -107.01, but in fact returned -9953.22
Note there is no explicit coercion on my return line - should there be??
e.g. MyFunc = CStr(Round(wOrderLinePrice - (wOrderCost / 100), 2))
or MyFunc = Round(wOrderLinePrice - (wOrderCost / 100), 2).toString
or is it something else??