If then problem

  • Thread starter Thread starter Bob L.
  • Start date Start date
B

Bob L.

This code doesn't work right (Access 2003). That is, it says it is
greater than zero yet if put a break point it shows the variable as
being 0.6. What is my problem?

Sub runit()
Dim dblTest As Double
dblTest = 0.6
If dblTest <= 0# Then
MsgBox "Less than zero"
Else
MsgBox "Greater than zero"
End If
End Sub

TIA
Bob L.
 
Bob said:
This code doesn't work right (Access 2003). That is, it says it is
greater than zero yet if put a break point it shows the variable as
being 0.6. What is my problem?

Sub runit()
Dim dblTest As Double
dblTest = 0.6
If dblTest <= 0# Then
MsgBox "Less than zero"
Else
MsgBox "Greater than zero"
End If
End Sub

TIA
Bob L.
Duhh, 0.6 is not less than zero!!!
 
It seems that your problem is that you don't understand that 0.6 actually IS
greater than 0.

Rob
 
Bob L. said:
This code doesn't work right (Access 2003). That is, it says it is
greater than zero yet if put a break point it shows the variable as
being 0.6. What is my problem?

Sub runit()
Dim dblTest As Double
dblTest = 0.6
If dblTest <= 0# Then
MsgBox "Less than zero"
Else
MsgBox "Greater than zero"
End If
End Sub

TIA
Bob L.
 
Back
Top