Not picking up table value

mapat

Registered User.
Local time
Today, 15:47
Joined
Feb 2, 2007
Messages
176
Hi everybody,

I have the following table:

ID ThicknessFieldRange1 ThicknessFieldRange2 Factor
16 0.0641 0.068 0.97
17 0.0681 0.072 0.98
18 0.0721 0.076 0.99

Now, I have a form that has a 'Thicknesstxtfield' that when calculated in the form its value is 0.072 in this case . Based on the range this value falls into, I want to get the correspondant 'Factor' which in this case would be '0.98'.
Guess what, ACCESS is telling me that it cannot find the value '0.072' in the table and gives me an error. Any ideas on this?

Notice that all the fields except "ID" are 'Doubles' with 4 decimal places, and I find the values using the 'DLookUp' function. I know that's where the error is because all the other ranges work fine.

Thanks everyone
 
Last edited:
Can you post the exact format of your DLOOKUP please
 
DLookup("[CornerStapleThickness]![ThicknessFactor]", "[CornerStapleThickness]", "[Forms]!
![BookThickness] >= [CornerStapleThickness]![ThicknessFieldRange1] And [Forms]!
![BookThickness] <= [CornerStapleThickness]![ThicknessFieldRange2]")

Note that the factor field I sent before is exactly named "ThicknessFactor"
Thanks
 
Can anyone help me out with this?

Thanks
 
mapat,

One (or more) of your calculated values is not what you think.

0.072 might really be 0.7399999999

You can use the Round function to "force" the comparison to
the required number of decimals.

Or use --> Abs(F1 - F2) > 0.0001

You could also use the Round function prior to storing the
value in a table
.

hth,
Wayne
 

Users who are viewing this thread

Back
Top Bottom