By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,967 Members | 1,690 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,967 IT Pros & Developers. It's quick & easy.

DLookup Expression for a Form controlled by a table that has ProjectNo controlled as

P: 1
I have the following Dlookup string to automatically pull up the Dnumber in a form which is created from EBO Tracking Table. I keep getting a data mismatch error.

DNumber = DLookup("Dnumber", "project list", ProjectNo = & "[Form]![EBO Tracking]![ProjectNo]")

I want to lookup the DNumber (Text) from the Project List Table with the criteria being ProjectNo (text - it is alpha numeric code) when the ProjectNo is entered into the EBO Tracking Form. However, in the EBO Tracking Table ProjectNo is a lookup wizard controlled by values entered into the Project List Table, which makes my ProjectNo field in EBO Tracking a number value.

So to sum up the Dlookup function DNumber = Dlookup ("Dnumber" (text field in Project List Table), "Project List" (Table to data), "ProjectNo =" (text field in Project List Table) & "[Form]![EBO Tracking]![ProjectNo]"(number value))

Thanks for your help.
Mar 1 '16 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 1,107
The Where Clause is quoted differently in the two examples you've provided. Either way, the following is more correct and it includes the Single Quotes that you will also need:
Expand|Select|Wrap|Line Numbers
  1. DNumber = DLookup("Dnumber", "project list", "ProjectNo ='" & [Form]![EBO Tracking]![ProjectNo] & "'")
Mar 1 '16 #2

Post your reply

Sign in to post your reply or Sign up for a free account.