I have a function call to convert feet to meters in my main form that looks like this:
txtTotalDepth.Value = Convert(txtTotalDepth.Value)
This calls the Conversion function which looks like this:
Function Convert(dblValue As Double) As Double
'Converts the measurement to metres
Dim dblresult As Double
dblresult = (dblValue * 0.3048) 'convert from feet to metres
dblresult = RoundAL(dblresult, 2) 'round off to two places
End Function
The Convert function calls a rounding function which works just fine...
I've stepped through the whole procedure watching the values to make sure they're correct.
The problem comes in passing the value *back* to the initial function... even when the final result of dblresult is, for example 213.36, the txtTotalDepth.Value ends up as 0.
Can somebody PLEASE tell me what I've done wrong? It's driving me nuts!
Thanks...
txtTotalDepth.Value = Convert(txtTotalDepth.Value)
This calls the Conversion function which looks like this:
Function Convert(dblValue As Double) As Double
'Converts the measurement to metres
Dim dblresult As Double
dblresult = (dblValue * 0.3048) 'convert from feet to metres
dblresult = RoundAL(dblresult, 2) 'round off to two places
End Function
The Convert function calls a rounding function which works just fine...
I've stepped through the whole procedure watching the values to make sure they're correct.
The problem comes in passing the value *back* to the initial function... even when the final result of dblresult is, for example 213.36, the txtTotalDepth.Value ends up as 0.
Can somebody PLEASE tell me what I've done wrong? It's driving me nuts!
Thanks...