Forum Discussion
Tony2021
Sep 13, 2023Steel Contributor
#Error in Query (nulls?)
Hello Experts, I am getting a #error in the below, I do have nulls on the Reference. How could I solve this issue? Not sure if its due to [Reference] having nulls. WDDateGetError: DLookUp(...
- Sep 14, 2023
Hi Tony,
> the format is short text for both of those fields.
Ok, then I misunderstood your description. I thought you were getting the error only for some records. With this information it is clear that you should get the error for every record because the syntax for text is different than for numbers. You have to put the text parameter in quotation marks:
WDDateGetError: DLookUp("MaxOfWithdrawalDate","qryWDDate","Reference = '" & [Invoice No] & "'"
[edited after XPS35 spotted the wrong column/field name]
Servus
Karl
****************
Access Forever
Access News
Access DevCon
Access-Entwickler-Konferenz AEK
Tom_van_Stiphout
Sep 14, 2023Steel Contributor
Although that is not your current problem: Reference is a Reserved Word, and should not be used as an object name. Just like you should not name your table "Table", or "Field". Nothing good can come from trying to confuse the Access parser.