Forum Discussion
Tony2021
Jan 19, 2025Steel Contributor
#Error in unbound text box
Hello Experts, I am trying to display nothing instead of #Error being displayed in an unbound text box. Its only showing on the new record row. The below is not working. It still displays #Erro...
- Jan 20, 2025
Use Nz to return a non-existing value for letterOfCreditID if it is Null:
=DLookUp("Beneficiary","[tblLetterOfCredit]","[LCID]=" & Nz([letterOfCreditID],0) & "")
Gustav_Brock
Jan 20, 2025Iron Contributor
If ID was text, Criteria should read:
"[LCID]='" & Nz([letterOfCreditID],0) & "'"However, here it is numeric, so no quotes, but I keep the closing double-quotes to keep the syntax and tell, that nothing is forgotten:
"[LCID]=" & Nz([letterOfCreditID],0) & ""A matter of coding style, I guess. Just like I prefer spelled variables like this and not abbreviated like ltrOfCrdtID
- Tony2021Jan 20, 2025Steel Contributor
ahh so its a style. Ok. I like hearing expert's different approaches. Thanks for adding that bit of info. I also see an advantage to spelling out instead of abbreviating.