Page 1 of 3 123 LastLast
Results 1 to 10 of 30

Thread: Look up data from another table

  1. #1
    Board Regular
    Join Date
    Jun 2009
    Posts
    137
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Look up data from another table

    Hi all,
    I am fairly new to Access and need some help or assistance in creating what would be a Vlookup if done in excel.

    What i have so far is two tables within the same access database

    Table one name Data
    Table two name Costs

    When someone selects a certain Material Part Number i want the lookup to look at this column in the "Data" table called and find that same number in the "Cost" table and to display the price which is also shown next to the Material Part Number within the Cost table in another cell within the same Data table

    I think once i may have it explained i should be ok to work on this for other look ups that i need to do within the same database.

    Hope somone can help and point me in the right direction.

    Regards

  2. #2
    Board Regular
    Join Date
    May 2013
    Posts
    404
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Look up data from another table

    Excel 2007

  3. #3
    Board Regular
    Join Date
    Jun 2009
    Posts
    137
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Look up data from another table

    I am looking at DLookup at the moment but just cant understand how it works, as i say i am ok with excel and Vlookup etc but this Dlookup is puzzling me

  4. #4
    Board Regular
    Join Date
    May 2013
    Posts
    404
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Look up data from another table

    I can't explain it any better than the link, sorry.
    Excel 2007

  5. #5
    MrExcel MVP
    Moderator
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    47,309
    Post Thanks / Like
    Mentioned
    37 Post(s)
    Tagged
    7 Thread(s)

    Default Re: Look up data from another table

    Did you look at the example in that link? They pretty much walk you through how to do it.
    Give it a try, and if you cannot get it to work, post the formula you put together here, and we can probably help you sort through the issues.

    Note that if you are using it in a Query, Form, or Report, you don't need to worry about the variable declaration and all that other stuff. Just enter the formula.
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  6. #6
    Board Regular
    Join Date
    Jun 2009
    Posts
    137
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Look up data from another table

    Hi all,
    Been looking at this all weekend and i just cant get my head around it at all :'(

  7. #7
    MrExcel MVP
    Moderator
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    47,309
    Post Thanks / Like
    Mentioned
    37 Post(s)
    Tagged
    7 Thread(s)

    Default Re: Look up data from another table

    if you cannot get it to work, post the formula you put together here, and we can probably help you sort through the issues.
    Can you post your formula attempt that did not work, like I asked previously? It might just be a minor tweak.

    Otherwise, please post some data samples, along with the exact field names.
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  8. #8
    Board Regular
    Join Date
    Jun 2009
    Posts
    137
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Look up data from another table

    Sorry

    =DLookUp("Price","Cost","Material Part Number=" & [Material Part Number])

    Price is the column in the Cost table

  9. #9
    MrExcel MVP
    Moderator
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    47,309
    Post Thanks / Like
    Mentioned
    37 Post(s)
    Tagged
    7 Thread(s)

    Default Re: Look up data from another table

    Where are you doing this (Query, Form, Report)?

    Note that the field names should be in square brackets:
    Code:
    =DLookUp("[Price]","Cost","[Material Part Number]=" & [Material Part Number])
    However, I have concerns about that part in blue. Where is that value coming from?
    Is that the exact name of a Text field on Form or Report? If so, you may need to preface it with the "Me." keyword.
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  10. #10
    Board Regular
    Join Date
    Jun 2009
    Posts
    137
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Look up data from another table

    Hi Joe,
    I am doing this on a Form
    Within the form i have a text box called Material Part Price and Material Part Number

    Put the Dlookup in Material Part Price and want it to look at the details found in Material Part Number and bring back the price from the Cost table


    Within the Cost table i have Material Part Number, Price, Material Description1 and Material Description2

    Hope i am making sense?

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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