Can someone solve the following puzzle for me? I ran across this in one
of my projects and can't believe this is how VB works. Somehow VB thinks
that 8.62 * 100 <> 862. I have a work-around but really would like to
know why this doesn't work.
Private Sub Form_Load()
Dim Amt1 As Double
Dim Amt2 As Double
Dim Amt3 As Double
Amt1 = 862
Amt2 = 8.62
Amt3 = Amt2 * 100
If Amt1 <> Amt3 Then
MsgBox ("All is lost")
End If
If Amt1 = Amt2 Then
MsgBox ("All is right with the world")
End If
End Sub
Ken Halter - 17 Oct 2007 20:29 GMT
> Can someone solve the following puzzle for me? I ran across this in one
> of my projects and can't believe this is how VB works. Somehow VB thinks
> that 8.62 * 100 <> 862. I have a work-around but really would like to
> know why this doesn't work.
Boy... this is definitely a faq this month!
See:
http://groups.google.com.my/group/microsoft.public.vb.general.discussion/msg/74b
7abbe3645bd1b

Signature
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm
NeilH - 18 Oct 2007 08:21 GMT
Try using Google as this is a FAQ!!!!
> Can someone solve the following puzzle for me? I ran across this in one
> of my projects and can't believe this is how VB works. Somehow VB thinks
[quoted text clipped - 21 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***