Dlookup problem

For floating-point numbers (i.e numbers with decimals) you can only use the equal sign for comparison IF the field/variables is declared as Currency (withing 4 decismals9 . Otherwise, you can never use the equal sign for comparison. To find out if two real numbers are "equal", the test is

If Abs(MyNumber-NumberToCompareWith) <SomeVerySmallNumberGiovenByPrecisionDesired Then
' they are equal
ENd IF
 
For floating-point numbers (i.e numbers with decimals) you can only use the equal sign for comparison IF the field/variables is declared as Currency (withing 4 decismals9 . Otherwise, you can never use the equal sign for comparison. To find out if two real numbers are "equal", the test is

If Abs(MyNumber-NumberToCompareWith) <SomeVerySmallNumberGiovenByPrecisionDesired Then
' they are equal
ENd IF

Im confused on what youre trying to say. If I cant use an equal sign hows come it works for EVERY other number in my table except one and if I type in the one that isn't working again it works fine.

Im also confused by your code
 
Even if you are confused, you still need to do what I say. The point is not that it works for every second number, but that it does not work for all. This has to do with computer representation of floating-point numbers -some are represented exactly and some aren't.
 
And I am getting a baby :D

Read my signature.
 
I did exactly what you said and yet you want to insult me. Alright.
 
LOL...
No. I cannot guess what you did exactly and how you did it exactly. Coding does not tolerate any sloppiness. And yet you expect me to guess, see, sense or whatever.. instead of simply showing what you did, as per my signature.

If you feel insulted, be my guest. :D
 
If you are having problems with only one single value, and if typing that value into a different record works, you may simply have a corrupt record.

Sometimes this can be fixed with a simple compact & repair or Decompile/Recompile
 

Users who are viewing this thread

Back
Top Bottom