I've written a function that takes three integers and returns a double. Any time I try to call it from a query it returns an error; select query will return #error, update or make table return a type conversion failure. ??
1) The code works fine when run in the immediate window of VBA editor
2) I'm sure that the values I'm passing it are of the correct type (integer)
3) I've tried update queries where the field for the calculated value is double (what it should be), variant, and text; all give type conversion error
4) When I first tested the code it worked fine, except that certain calls resulted in division by zero. I changed one line of arithmatic code, now I'm having this problem
Function plot_live_C(intInst As Integer, intPlot As Integer, intMeas As Integer) As Double
'some stuff happens in here, works great in VBA editor
sample SQL select query is
SELECT tMeasurement_Dates.installation, tMeasurement_Dates.plot, tMeasurement_Dates.measurement, plot_live_C([tMeasurement_Dates]![installation]),([tMeasurement_Dates]![plot],[tMeasurement_Dates]![measurement]) AS liveC
Thanks for any help, I'm baffled!