+ Reply to Thread
Results 1 to 4 of 4

Thread: Looking Up Values using Lookup Table (in Excel would be a vlookup)

  1. #1
    Registered User
    Join Date
    03-28-2010
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    27

    Looking Up Values using Lookup Table (in Excel would be a vlookup)

    Hello,

    I am a novice Access user and have a database I need help with. I know there have been multiple threads similar to this, but I think my situation is unique, so I hope this is not a repeat. My database has one table that is a linked ODBC table and a lookup table I put together. I have a make table query that turns the linked table into a static table. There are no primary keys in my tables as this is not possible since it has repeating data (sales data).

    One of the fields/columns of my static sales data table (tbSalesData) has a code for a product category. What I am trying to do is create a query/lookup/whatever so that I can take that product code and turn it into text that is the actual category. Here is an example of my tables

    tbSalesData
    SKU Sales Cost ProductCategoryCode


    tbCategoryLookup
    ProductCategoryCode CategoryDescription


    So I am trying to essentially equate ProductCategoryCode in tbSalesData to CategoryDescription in tbCategoryLookup. I feel like all my efforts are in vain because the lack on keys. Anyway- I certainly appreciate nay help that can be provided.

    Thank you very much!
    Last edited by learning_vba; 07-26-2011 at 02:04 PM. Reason: Solved

  2. #2
    Forum Guru ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    traded up
    MS-Off Ver
    2003 & 2010
    Posts
    1,905

    Re: Looking Up Values using Lookup Table (in Excel would be a vlookup)

    Hi,

    In the table tblCategoryLookup, are there duplicate entries of the ProductCategoryCode? If not, then it is a primary key in that table. You can use it (with a join) to create a query to give the results you seek.

    Cheers,
    “To sin by silence when they should protest makes cowards of men.” ~ Abraham Lincoln

  3. #3
    Registered User
    Join Date
    03-28-2010
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Looking Up Values using Lookup Table (in Excel would be a vlookup)

    Quote Originally Posted by ConneXionLost View Post
    Hi,

    In the table tblCategoryLookup, are there duplicate entries of the ProductCategoryCode? If not, then it is a primary key in that table. You can use it (with a join) to create a query to give the results you seek.

    Cheers,
    Hi- thank you for your response. There are no duplicate entries- each one is unique, so I am glad to hear this is possible. I really appreciate your response, and if you would be willing, I would greatly appreciate instructions on how to make the query with the join.

    Thank you!


    I have figure it out - thanks so much!
    Last edited by learning_vba; 07-26-2011 at 02:03 PM. Reason: Figured it out!!

  4. #4
    Forum Guru ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    traded up
    MS-Off Ver
    2003 & 2010
    Posts
    1,905

    Re: Looking Up Values using Lookup Table (in Excel would be a vlookup)

    Sure,

    First, I recommend opening the table design view for tblCategoryLookup and setting the ProductCategoryCode as a primary key.

    For the query:

    1. Create a select query (in design view)

    2. Add the two tables to the query

    3. Join the tables on the ProductCategoryCode by dragging one field and dropping it on the other.

    Select whichever fields you'd like to see for display and run the query.

    Cheers,
    “To sin by silence when they should protest makes cowards of men.” ~ Abraham Lincoln

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0