Results 1 to 4 of 4
  1. #1
    JustAnElf is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2013
    Posts
    16

    Lookup values instead of ID numbers

    Greetings one and all,

    Sadly, I’m a bit confused when it comes to MS Access queries and I’m hoping someone can point me in the right direction. I have two tables. Table 1 looks like this:

    Table1
    Key Number
    User Name Short Text
    Company 1 Number
    Company 2 Number

    The data is
    Key User Company1 Company2
    1 Bryan 1 2
    2 George 2 2
    3 Chris 3 1

    The Company 1 and 2 fields contain the ID numbers in Table 2.

    Table 2 looks like this:

    Table2
    CompKey Number
    CompanyName Short Text

    The data is
    CompKey CompanyName
    1 CSC
    2 IBM
    3 HP
    4 Dell

    My goal is to run a query so the user name and the text of the two company fields look like this.

    Bryan CSC IBM
    George IBM IBM
    Chris HP CSC

    If I link a relationship to the query to one of the company names I will get something like this:

    Bryan CSC 1
    George IBM 2


    Chris HP 3

    If I link a relationship to both of the companies, the query will AND the two fields together and only show me the user name if their values are equal.

    The results look like this
    George IBM 2

    How do I setup the query so it shows me the values for both fields and not the key? At this point all I really want the queue to do is replace the numbers with the text equivalent.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    It would be easier to show you if you could post this db, or a sample of it. It is a matter of including Table2 in the query twice.

  3. #3
    JustAnElf is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2013
    Posts
    16
    AWE MAN!! I didn't know you could add the same table twice. I've been beating my head on the table for several hours trying to figure this out. Once I added it, the rest was easy.

    Thank you. Your suggestion did the trick.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    Outstanding! I was not sure my words would make sense to you. Did you already use the Thread Tools at the top of the thread to mark this thread as Solved?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 02-12-2012, 02:58 PM
  2. duplicate lookup values
    By andy33 in forum Database Design
    Replies: 2
    Last Post: 11-18-2011, 03:07 PM
  3. Lookup Values
    By jbarrum in forum Access
    Replies: 6
    Last Post: 12-31-2009, 08:58 AM
  4. Replies: 2
    Last Post: 09-10-2009, 05:42 AM
  5. Lookup Values
    By gjw1012 in forum Access
    Replies: 5
    Last Post: 07-22-2009, 08:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums