Ran into this yesterday.
Here are two snippets of code that for all intents and purposes mathmatically are the same.
On a form place a command button and put the following code behind it.
Private Sub Command1_Click()
Dim dblResult
dblResult = 3418 * 68
MsgBox dblResult
End Sub
I get an overflow error on the multiplication. Have tried declaring the variable as double, integer etc.
Now try this
Private Sub Command1_Click()
Dim dblResult
dblResult = (34180 / 10) * 68
MsgBox dblResult
End Sub
Version is VB6 SP5
Thanks in advance
Andy
Andy Baldwin
Here are two snippets of code that for all intents and purposes mathmatically are the same.
On a form place a command button and put the following code behind it.
Private Sub Command1_Click()
Dim dblResult
dblResult = 3418 * 68
MsgBox dblResult
End Sub
I get an overflow error on the multiplication. Have tried declaring the variable as double, integer etc.
Now try this
Private Sub Command1_Click()
Dim dblResult
dblResult = (34180 / 10) * 68
MsgBox dblResult
End Sub
Version is VB6 SP5
Thanks in advance
Andy
Andy Baldwin