Overflow

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Any help will be appreciated. Thanks.

Error Msg Overflow

dim MyDbl as Double

MyDbl = (([txtTotQty] - [txtTotProd]) / [txtTotQty]) * 100
txtResult = MyDbl

MyDbl value is 97.9166666666667
I want to format 'txtResult' as whole number in percentage.
 
Which line causes the "overflow" message? If txtResult is a bound control,
what is the data type and size of the field that txtResult is bound to?
Also, if it is a bound control, why? Why not just make the calculation when
you need it?

It is also possible that you may need to assign txtTotQty and txtTotProd to
an appropriately declared variable then use those variables in the equation.
This would only apply if the equation line is the one generating the error.
Is txtTotProd or txtTotQty ever Null or zero?
 
Thanks Wayne. Your reply was very helpful.

Wayne Morgan said:
Which line causes the "overflow" message? If txtResult is a bound control,
what is the data type and size of the field that txtResult is bound to?
Also, if it is a bound control, why? Why not just make the calculation when
you need it?

It is also possible that you may need to assign txtTotQty and txtTotProd to
an appropriately declared variable then use those variables in the equation.
This would only apply if the equation line is the one generating the error.
Is txtTotProd or txtTotQty ever Null or zero?

--
Wayne Morgan
MS Access MVP


skk said:
Any help will be appreciated. Thanks.

Error Msg Overflow

dim MyDbl as Double

MyDbl = (([txtTotQty] - [txtTotProd]) / [txtTotQty]) * 100
txtResult = MyDbl

MyDbl value is 97.9166666666667
I want to format 'txtResult' as whole number in percentage.
 
Back
Top