Error 6 "Overflow"

luzz

Registered User.
Local time
Yesterday, 16:44
Joined
Aug 23, 2017
Messages
346
Hi all, I am facing this error when i want to calculate the weight on my form.

the weight i want to convert is 32800lbs to KG with this formula (lbs/2.2046)
but when i click on my button, it show error message "Overflow" I change the data type to long integer in my table and it still did not work
how to fix this?
 
...when i click on my button, it show error message "Overflow" I change the data type to long integer in my table and it still did not work
how to fix this?
A good start would be to show the full code for the calculation.

A Long Integer stores only whole numbers. The result of your conversion will have several decimal digits. If you don't want to loose them you should rather use the Double data type. - This is however not the cause of the error.
 
Change the field ir variable to double type
 
you answered your own question. Integers cannot use decimals.
 
Its nothing to do with the conversion to kg
The integer limit is 32767 so 32800 will cause the overflow error

Long integer would be OK for 32800 but not for the d.p. needed in the calculation.

As previously stated by everyone else, change datatype to double so you can handle both large numbers and decimal places
 
Thank you all for the useful input! I have solved it.
 

Users who are viewing this thread

Back
Top Bottom