Link to home
Start Free TrialLog in
Avatar of Justin
Justin

asked on

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
Avatar of Eric Sherman
Eric Sherman
Flag of United States of America image

Is the New Kondor ID included in the table [Iam Mapping] ???

ET
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
Avatar of Justin
Justin

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of Eric Sherman
Eric Sherman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Justin

ASKER

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
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