SeanNij
asked on
Overflow Error on Calculation
Morning all,
Trying to calculate the wieight on a punch in Microsoft Access (form) in order to calculate the transport charge.
I'm getting an overflow on the following line of code. Can anyone help me overcome this?
w_calc = 3.14159265 * (Me.ShankDiameter / 10) ^ 2 * Me.OverallLength * 7.8 / 10 * 4 * 1000
shankdiameter = 4
overalllength = 80
Thanks
Sean
Trying to calculate the wieight on a punch in Microsoft Access (form) in order to calculate the transport charge.
I'm getting an overflow on the following line of code. Can anyone help me overcome this?
w_calc = 3.14159265 * (Me.ShankDiameter / 10) ^ 2 * Me.OverallLength * 7.8 / 10 * 4 * 1000
shankdiameter = 4
overalllength = 80
Thanks
Sean
ASKER
w_calc is long
shankdiameter is single
overlength is single
shankdiameter is single
overlength is single
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
nope - same error
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Me.WeightPP = 3.14159265 * (Me.ShankDiameter / 10) ^ 2 * Me.OverallLength * 7.8 / (10 * 4 * 1000)
That works for me as well.
Go into the immediate pane and try:
?3.14159265 * (4 / 10) ^ 2 *80 * 7.8 / (10 * 4 * 1000)
Go into the immediate pane and try:
?3.14159265 * (4 / 10) ^ 2 *80 * 7.8 / (10 * 4 * 1000)
ASKER
RunTime Error '6'
Overflow i use immediate window
Overflow i use immediate window
Check that you don't have any missing references
ASKER
brand new database
started from scratch yesterday on it.
what i did was uninstall office service pack 3 yesterday, cuase since i installed it my Access keeps crashing in weird places.
since uninstalling been fine....except for this error now....
started from scratch yesterday on it.
what i did was uninstall office service pack 3 yesterday, cuase since i installed it my Access keeps crashing in weird places.
since uninstalling been fine....except for this error now....
ASKER
hmmm
Me.WeightPP = 3.14159265 * (Me.ShankDiameter / 10) ^ 2 * Me.OverallLength * 7.8 / (10 * 4 * CLng(1000))
works....
WTF!!!!!!!!!!!!!
Me.WeightPP = 3.14159265 * (Me.ShankDiameter / 10) ^ 2 * Me.OverallLength * 7.8 / (10 * 4 * CLng(1000))
works....
WTF!!!!!!!!!!!!!
That might be an explanation. I never moved to SP3 because of all the problems reported as soon as it was issued.
So my examples are all on sp2.
So my examples are all on sp2.
ASKER
Splitting points for all the input - but the Clng got me working!
Thanks!
Thanks!
Glad you got it working!
What Data_Type are w_calc ,shankdiameter & overalllength ? (integer,single etc)
Gary