How to do a Dlookup in Access?

Hi Guys, I have a query called New Kondor and a column called "New Kondor ID" and I need to bring in the Old Kondor ID via a Lookup table in Access called Iam Mapping Table. Can anyone help me bring it in?
db1.mdb
JCutcliffeAsked:
Who is Participating?
 
Eric ShermanConnect With a Mentor Accountant/DeveloperCommented:
<<<<<Hi ET, the mapping table is called "Iam Mapping" so should that be not be in square brackets?>>>>>

"Iam Mapping" =  the Domain in the DLookup paramaters ... enclosed in double quotes will work.

<<<<<I am trying to bring back the field called "Old Kondor Id" in the "New Kondor Id" field within the Query "New Kondor". The mapping table has both "Old Kondor Id" and "New Kondor ID" fields.>>>>>

Sorry, the statement above is a bit confusing  ....  <<<<<I am trying to bring back the field called "Old Kondor Id" in the "New Kondor Id" field within the Query "New Kondor".

I tried to open your sample but there is nothing in it.  Can you upload a sample of your db.  Should be pretty easy.  I need to know which table has the "Old Knodor Id" along with the "New Kondor Id".

ET
0
 
Eric ShermanAccountant/DeveloperCommented:
Is the New Kondor ID included in the table [Iam Mapping] ???

ET
0
 
Eric ShermanAccountant/DeveloperCommented:
If the New Kondor ID is in the lookup table then ...

In your query add ...

Old_Kondor_ID: DLookup("[Old_Kondor]", "Iam Mapping", "[New Kondor ID] = '" & [New Kondor ID] & "'")

Or, you could set a relationship between the two tables based on the New Kondor ID field then include the Old Kondor ID field in your query results.

ET
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
JCutcliffeAuthor Commented:
Hi ET, the mapping table is called "Iam Mapping" so should that be not be in square brackets?

I am trying to bring back the field called "Old Kondor Id" in the "New Kondor Id" field within the Query "New Kondor". The mapping table has both "Old Kondor Id" and "New Kondor ID" fields.

Justin
0
 
JCutcliffeAuthor Commented:
Hi, the table which has both fields in is called "Iam mapping". My query "New Kondor" only has "New Kondor Id" and I am trying to import into it the "Old Kondor Id" field.


Justin
0
 
Eric ShermanAccountant/DeveloperCommented:
Ok, sounds like you want to update the [Old Kondor Id] field with the values in the [New Kondor Id] field for each record in table [Iam mapping].

1.) Make a copy of your Iam mapping table first or backup your current db.
2.) Run the query below:

UPDATE [Iam mapping] SET [Old Kondor Id] = [New Kondor Id];


ET
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.