Hi I have the following query which refers to a textbox on a form which has a number in it, number could be negative positive or 0 and the query needs to select which row the value falls between i.e less than reference but >= reference2. for a value of 5.2 I get the following.
If I put values into the Expr2 expression rather than link to textbox then It works. I don't know what to do next appreciate any help
see attached picture of query and SQL below.
SELECT [External Calibrations RD].ID, [External Calibrations RD].[Ext Calibration Date], [External Calibrations RD].Ref, [External Calibrations RD].[True], [External Calibrations RD].Reference, IIf(([Forms]![frmRD Entry]![Ref 1 Average]<[Reference]) And ([Forms]![frmRD Entry]![Ref 1 Average]>=[Reference2]),True,False) AS Expr2, DLookUp("[True]","qryRef1Range","[ID]=" & [ID]-1) AS True2, DLookUp("[Reference]","qryRef1Range","[ID]=" & [ID]-1) AS Reference2
FROM [External Calibrations RD]
WHERE ((([External Calibrations RD].Ref)=[Forms]![frmRD Entry]![Ref 1]));
If I put values into the Expr2 expression rather than link to textbox then It works. I don't know what to do next appreciate any help
see attached picture of query and SQL below.
SELECT [External Calibrations RD].ID, [External Calibrations RD].[Ext Calibration Date], [External Calibrations RD].Ref, [External Calibrations RD].[True], [External Calibrations RD].Reference, IIf(([Forms]![frmRD Entry]![Ref 1 Average]<[Reference]) And ([Forms]![frmRD Entry]![Ref 1 Average]>=[Reference2]),True,False) AS Expr2, DLookUp("[True]","qryRef1Range","[ID]=" & [ID]-1) AS True2, DLookUp("[Reference]","qryRef1Range","[ID]=" & [ID]-1) AS Reference2
FROM [External Calibrations RD]
WHERE ((([External Calibrations RD].Ref)=[Forms]![frmRD Entry]![Ref 1]));