Runtime error '2465' : can't find the field '|1' referenced (1 Viewer)

gblack

Registered User.
Local time
Today, 05:03
Joined
Sep 18, 2002
Messages
632
Sorry I originally, accidentally, posted this in the Macros section... when I meant to post this here:

I keep getting this error:

can't find the field '|1' referenced to in your expression

Here's where it bugs out:
Code:
[qryBuyPlan_Working subform1].Form.RecordSource = 
"SELECT 
BUY_PLAN_ID, 
BuyListID, 
BUY_LIST_ID, 
FUNDING_LINE, 
FUNDING_CONTROL_TYPE, 
PRIOR_QUANTITY_SHORTS, 
PRIOR_QUANTITY_OA, 
FYDP0_QUANTITY_SHORTS, 
FYDP0_QUANTITY_OA, 
FYDP1_QUANTITY_SHORTS, 
FYDP1_QUANTITY_OA, 
FYDP2_QUANTITY_SHORTS, 
FYDP2_QUANTITY_OA, 
FYDP3_QUANTITY_SHORTS, 
FYDP3_QUANTITY_OA, 
FYDP4_QUANTITY_SHORTS, 
FYDP4_QUANTITY_OA, 
FYDP5_QUANTITY_SHORTS, 
FYDP5_QUANTITY_OA, REMARKS, 
NSN_ONLY 
FROM 00080_BUY_PLAN_WORKING 
WHERE (((BUY_PLAN_ID) Not Like 'NEW*') AND (Not (NSN_ONLY)=True));"

I think it might be the where clause, but I have no idea what it could be. I have also tried:
Not Like 'NEW*'
and...
Not Like " & chr(34) & "NEW*" & chr(34) & " ...

What am I doing wrong, here? Or could it be something else that's causing my issue?

V/R,
Gary Black
 
Last edited:

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 05:03
Joined
Sep 12, 2006
Messages
15,653
try putting your record source into a design query, until you get it working - then you will be able to see what the SQL ought to look like


"SELECT
BUY_PLAN_ID,
BuyListID,
BUY_LIST_ID,
FUNDING_LINE,
FUNDING_CONTROL_TYPE,
PRIOR_QUANTITY_SHORTS,
PRIOR_QUANTITY_OA,
FYDP0_QUANTITY_SHORTS,
FYDP0_QUANTITY_OA,
FYDP1_QUANTITY_SHORTS,
FYDP1_QUANTITY_OA,
FYDP2_QUANTITY_SHORTS,
FYDP2_QUANTITY_OA,
FYDP3_QUANTITY_SHORTS,
FYDP3_QUANTITY_OA,
FYDP4_QUANTITY_SHORTS,
FYDP4_QUANTITY_OA,
FYDP5_QUANTITY_SHORTS,
FYDP5_QUANTITY_OA, REMARKS,
NSN_ONLY
FROM 00080_BUY_PLAN_WORKING
WHERE (((BUY_PLAN_ID) Not Like 'NEW*') AND (Not (NSN_ONLY)=True));"

I suspect the issue is the red terms - but it may be a mistyping of one of the other terms.

Out of interest the repeated terms FYDPn, etc would in general indicate that your data is not properly normalised.
 

Users who are viewing this thread

Top Bottom