PDA

View Full Version : Help with Access for Lookup



aravindkm
2017-09-19, 02:44 PM
Hi All,

Could anyone Please help me out with a lookup function in access where I have an identical data for 2 tables however I need a Employee salary to be picked from Table 2 to table 1.

See below the Table 1 & table 2 for your reference.

I need the salary in the table 1.

Table 1



Table1




ID

Employee Id

Employee Name








2

44130089

Arun







3

44030188

Kavitha







4

40031189

Raja







5

40012289

Ravi







6

40036719

Ganesh









Table 2

Table2




ID

Employee Id

Employee Name

Salary








1

44130089

Arun

600000







2

44030188

Kavitha

700000







3

40031189

Raja

650000







4

40012289

Ravi

675500







5

40036719

Ganesh

550000

retired007geek
2017-09-19, 11:30 PM
aravindkm,

You don't need a formula in Access you just need to create a Join (join the two tables together) in your Access Query based on the Employee ID. You can then use the Query as the basis for your forms or reports and access any information in either table directly. Note: this does NOT change the structure of either table.

HTH :cool:

aravindkm
2017-09-20, 07:12 AM
Hi geek,

Could you please let me know how to create a join between the two tables together.


Thanks

retired007geek
2017-09-20, 09:54 PM
aravindkm,



Create a new query.
Add your to tables to the query design.
Drag "Employee ID" from one table and drop it on top of "Employee ID" in the other one.
Drag the required fields to the design grid from the desired table.
View the report.


7399

7400

HTH :cool:

alansidman
2018-10-01, 06:03 PM
Also, here is the SQL statement


SELECT Table1.[Employee Name], Table2.Salary
FROM Table1 INNER JOIN Table2 ON Table1.[Employee Id] = Table2.[Employee Id];

Pecoflyer
2018-10-01, 06:14 PM
Alan, this thread is one year old. Not much chance of getting an answer...