|
-
Oct 6th, 2004, 05:51 AM
#1
Thread Starter
Hyperactive Member
Overflow error ... Resolved
Hello,
Can somebody tell me why I get a Run-time Overflow error on this code?
Option Explicit
Option Compare Text
Dim Units As String
Dim UnitNum As Integer 'How many units to convert from text1
Dim EqualsNum As Integer 'Equals Box
Dim AcreFeetFactor As Double 'Error occurs when this one is used.
Dim AcreYardFactor As Double
Dim AcreMeterFactor As Double
________________________________________________
Private Sub ConvertButton_Click()
If Units = "Acre" Then
UnitNum = Text1
AcreMeterFactor = 4.047
AcreFeetFactor = 43560 'The error occurs when this one is used.
AcreYardFactor = 4840
If ComboToUS.Text = "square feet" Then
EqualsNum = AcreFeetFactor * UnitNum
End If
If ComboToUS.Text = "square yards" Then
EqualsNum = AcreYardFactor * UnitNum
End If
If ComboToMetric.Text = "square meters" Then
EqualsNum = AcreMeterFactor * UnitNum
End If
End If
EqualsBox = EqualsNum
End Sub
Run-time error 6:
Overflow
Last edited by GARY MICHAEL; Oct 7th, 2004 at 06:56 AM.
Thanks,
GARY
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|