Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLookup help 1

Status
Not open for further replies.

WallT

Vendor
Aug 13, 2002
247
US
I use the following DLooUp string on a form to show the company name from the Customers table after I enter an account number on my "Order Form". For some reason the Company Name text box shows as an "Error" until I add the account number. Shouldn't that just be blank until I enter an account number? The Account Number is a "Number" value.

=NZ(DLookUp("CompanyName","tbl_Customers","AccountNumber =" & [DBAccountNumber]),Null)
 
=NZ(DLookUp("CompanyName","tbl_Customers","AccountNumber =" & [DBAccountNumber]),[!]""[/!])

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
That works after I enter the Account Number, but it still shows as an error if the Account Number field is blank.

Do you think it may have to do with the fact that my Forms Record Source is a Query?
 
=NZ(DLookUp("CompanyName","tbl_Customers","AccountNumber=" & Val([DBAccountNumber] & "")),"")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank you very much...you wouldn't happen to know where I can read an article or something regarding the "Val
 
where I can read an article or something regarding the "Val"
Put the cursor inside the "Val" word in your code and press the F1 key.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top