Results 1 to 6 of 6
  1. #1
    nicnicman is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    7

    Query column info rather than actual value

    In a table I have a field that gets its value from a lookup with multiple columns. Is it possible to query information in the columns rather than the actual value.



    Here is an example of a single field value in the table I want to query (this would be in a drop down box in the table):

    ID | Name
    1 Nick
    2 Nick

    The actual values are the 1 and 2, but I would like to query the name 'Nick'. How would I do this?

    Thanks for any suggestions.

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    In your query, you need to join the lookup table with the main table. Include the Name field from the second table in your query grid. Include the FK from the main table and this is what you will filter on, but make sure that the display box for this field is unchecked.

    BTW: All lookups should be performed in a form and not directly in a table. Look here:
    http://access.mvps.org/access/lookupfields.htm

    Alan

  3. #3
    nicnicman is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    7
    Thanks for the help, but I'm not sure what you mean by FK.

  4. #4
    nicnicman is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    7
    That was an eye-opening read about look-up tables. My instructor actually requested that I add the look-ups for easier data entry. However, from what I was just reading, data entry should be performed in forms.

  5. #5
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Foreign Key. It is ID in the main table that links to the Primary Key in the lookup table.

  6. #6
    nicnicman is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    7
    Okay, thanks. I got it working.

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

Similar Threads

  1. Replies: 6
    Last Post: 07-25-2012, 06:42 AM
  2. Budget vs Actual
    By chaos in forum Access
    Replies: 1
    Last Post: 05-04-2011, 08:25 AM
  3. Replies: 12
    Last Post: 01-31-2011, 12:37 PM
  4. Replies: 7
    Last Post: 04-27-2010, 02:47 PM
  5. Passing specific Combobox info to a query
    By pwdpwd in forum Queries
    Replies: 1
    Last Post: 02-09-2010, 12:53 PM

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