Results 1 to 6 of 6

Thread: Help with Access for Lookup

  1. #1

    Post Help with Access for Lookup



    Register for a FREE account, and/
    or Log in to avoid these ads!

    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


    ID Employee Id Employee Name
    2 44130089 Arun
    3 44030188 Kavitha
    4 40031189 Raja
    5 40012289 Ravi
    6 40036719 Ganesh


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

  2. #2
    Acolyte retired007geek's Avatar
    Join Date
    Jun 2017
    Location
    South Carolina, USA
    Posts
    86
    Articles
    0
    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

  3. #3
    Hi geek,

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


    Thanks

  4. #4
    Acolyte retired007geek's Avatar
    Join Date
    Jun 2017
    Location
    South Carolina, USA
    Posts
    86
    Articles
    0
    aravindkm,


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


    Click image for larger version. 

Name:	AccessQryDesign.PNG 
Views:	11 
Size:	14.5 KB 
ID:	7399

    Click image for larger version. 

Name:	AccessQryResult.PNG 
Views:	7 
Size:	9.0 KB 
ID:	7400

    HTH

  5. #5
    Conjurer alansidman's Avatar
    Join Date
    Oct 2018
    Location
    Steamboat Springs
    Posts
    137
    Articles
    0
    Excel Version
    2019
    Also, here is the SQL statement
    Code:
    SELECT Table1.[Employee Name], Table2.Salary
    FROM Table1 INNER JOIN Table2 ON Table1.[Employee Id] = Table2.[Employee Id];

  6. #6
    Wizard Pecoflyer's Avatar
    Join Date
    Oct 2011
    Location
    Brussels Belgium
    Posts
    1,636
    Articles
    0
    Excel Version
    2010 on Xubuntu
    Alan, this thread is one year old. Not much chance of getting an answer...
    Thank you Ken for this secure forum.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •