Results 1 to 2 of 2
  1. #1
    aarotech is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    3

    Using a Field Value to set the Field you want to select in a query.

    I have a table (Data) that has field's that are named with numbers (10,13,15,17, etc.).



    I want to set up a expression that uses a field value from another table to select the field mention above.

    This is the way I thought to do it but dosn't work.
    example:

    Calc_Data: [Depr]![[Equip_Codes]![Life]]

    Depr is the table
    Table (Equip_Codes) field (Life) is where I want to get the value to select the Field in the above the table (Data).

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Don't understand. You identify 3 tables - Data, Depr, Equip_Codes. Reference [Depr]![[Equip_Codes]![Life]] doesn't make sense.

    Maybe:

    SELECT *, DLookup("[" & [Life] & "]", "Depr", "criteria to determine which record to get value from") As Calc_Data FROM [Equp_Codes];
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Select query for Yes/No field
    By orcaa in forum Queries
    Replies: 1
    Last Post: 12-30-2012, 06:02 AM
  2. Select Query > Update Query > Table Field
    By tuggleport in forum Queries
    Replies: 2
    Last Post: 08-09-2012, 07:04 AM
  3. use parameter in field name of select query
    By focosi in forum Queries
    Replies: 2
    Last Post: 02-11-2012, 10:34 AM
  4. Select Case using query field
    By focosi in forum Programming
    Replies: 4
    Last Post: 08-15-2011, 11:00 AM
  5. Replies: 4
    Last Post: 07-27-2011, 09:52 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