y2j
y2j

Reputation: 207

run time error 2465

I am getting error in MS access 2003, Run Time Error 2465: Microsoft can't find the field '|' referred to in your expression.

Count = DCount("*", "PREPAYMENT_PRICING_CHANGE", ([INSERT_DATE] - Int([INSERT_DATE])) = ([Now()] - Int([Now()])))
db.Execute "INSERT INTO tbl_audit ([FilePath],[FileName],[action],[trans_date],[button],[number_of_records])" _
       & " values ( '" & strFName & "', '" & File & "'  , ""'Import_of_NTS_rate_PCD_file'""  ,Now() ,""'Import NTS rates from file'"",'" & Count & "');"

Upvotes: 0

Views: 336

Answers (1)

kiks73
kiks73

Reputation: 3778

I think that you forgot the " in the DCount condition:

Count = DCount("*", "PREPAYMENT_PRICING_CHANGE", "([INSERT_DATE] - Int([INSERT_DATE])) = ([Now()] - Int([Now()]))")

Also try to escape your variables:

db.Execute "INSERT INTO tbl_audit ([FilePath],[FileName],[action],[trans_date],[button],[number_of_records])" _
       & " values ( '" & Replace(strFName,"'","''") & "', '" & Replace(File,"'","''") & "'  , ""'Import_of_NTS_rate_PCD_file'""  ,Now() ,""'Import NTS rates from file'"",'" & Count & "');"

Upvotes: 1

Related Questions