I just finished Expert Course 10. Can you use DLOOKUP to pull a calculated or concatenated field (whose value is stored in one field) and pull that value into another table? Could this save having to recalculate the value each time? --Kent Jamison
Adam Schwanz
@Reply 4 years ago
If you are storing the value in a table, you can dlookup the value from the table. If it's a calculation in a query, you can still dlookup it but it will have to run the query calculation to find out what that value is, so it wouldn't save you time in that regard.
Kent JamisonOP
@Reply 4 years ago
But can you DLOOKUP a value from ANOTHER table and pull it into the current table?
Why do you need to?
Why not just create a query to join the two Tables.
Adam Schwanz
@Reply 4 years ago
What do you mean pull it into the current table? If you want to make a form and the default value or a button or something pull a value from another table and set that fields value to that, then yes you can. Likewise you could run an update query with dlookup and add values between tables.
Say table 1 is an orderdetail table, has part number and price in it among other fields.
Table 2 is the parts table, has the part number and price in it.
You can DLOOKUP the price from table 2 based on the part number and automatically put that price into table1 for the price of that part on that order kind of thing.
Kent JamisonOP
@Reply 4 years ago
Let me provide an example. Sometimes, for convenience sake, it's helpful to pull in data from another table to understand what you're looking at. I have an employee db, with basic employee data (e.g., names, phone numbers, emails, etc.) in my main Employee table, but the additional employee particulars are stored in a separate table (e.g., how long they've worked for the company). When reviewing that additional info table, it sure would be nice to see the LastName next to the AdditionalInfoID of an employee just so you know what you're looking at and info belongs to whom. How do I lookup and pull the LastName from the main EmployeeT into the AdditionalInfoT? No one can remember what customer has what ID when you have hundreds of employees in a table.
Please advise.
Kent J.
I see what you're saying, Kent, but in that case you wouldn't "pull" the additional info data into your actual employee table. You don't want to have information copied in two places if you can avoid it. Usually. In this case, just use a DLookup function in an unbound form field.
"How do I lookup and pull the LastName from the main EmployeeT into the AdditionalInfoT?" - I would make a button that opens the Additional form from the Employee form and set the EmployeeID as a default value. Just like I do in Contacts and Invoicing.
Kent JamisonOP
@Reply 4 years ago
Thanks Richard. Makes sense. I'll review those videos today. I'm gathering in Access you always review data in forms, not tables. Correct? The one issue I have with reviewing records in forms is forms only let you review data one record at a time, unless I'm missing some trick. I find using tables is often faster when COMPARING records because you can see multiple records at once. That's where my ask is coming from. Your thoughts?
--Kent J.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Expert 10.