Results 1 to 3 of 3
  1. #1
    boboivan is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Dec 2015
    Posts
    65

    find values based on text criteria

    Hello!

    Is it possible to be automatically added in a query table (or a simple table) a value associated with a text criteria?
    The list of text criteria and its associated values are in a different table.
    I've made my research and I could find the dlookup function. I've tried it and returns error.

    The formula I've tried is:
    Code:
    DLookUp("column3/table2 - Values I'm looking for associated with the text criteria","table2 - of criteria and its values","column2/table2 - the list of text criteria=" & [column1/table1 - where the text criteria are added])
    In other words, If I add a text value (an word) in column, I'd like to have its associated numerical value in another column.

    From all that I could see on internet, this function works only based on ID column, which is not what I need.

    Thx!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,951
    This is what queries are for - to join related tables so that associated info can be viewed. So why not build query that joins these tables? Why use DLookup?

    Any field can be used as criteria, not just an ID field. But if you are not saving an ID from table 2, why even have an ID field?

    For example:

    DLookup("table2numberfieldname", "table2name", "table2textfieldname='" & table1textfieldname & "'")

    Use your actual table and field names in place of the generic examples.
    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.

  3. #3
    boboivan is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Dec 2015
    Posts
    65
    Thank you June7 for your answer!

    Indeed, there is no need for ID in table2, so I'm going to delete that field. This table2 serves as reference for many other tables and queries I want to develop. In table2 is a list of specific word that are associated with specific values. Every time the user adds any specific word in any other table, it is necessary to automatically extract that associated value from table2.

    I really don't know if joining tables every time I need an association would be an easy task for me . I'll try though to do that.

    Thank you again.

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

Similar Threads

  1. Replies: 3
    Last Post: 06-23-2014, 02:02 PM
  2. disable text box based on criteria
    By DCV0204 in forum Forms
    Replies: 4
    Last Post: 01-31-2014, 02:38 PM
  3. Counting text entries based on criteria
    By benjammin in forum Queries
    Replies: 6
    Last Post: 07-22-2013, 09:55 AM
  4. find all text string in Criteria at once
    By Jerseynjphillypa in forum Queries
    Replies: 3
    Last Post: 05-15-2012, 12:12 PM
  5. Summation of Types (based on text criteria)
    By justinwright in forum Reports
    Replies: 4
    Last Post: 01-26-2011, 01:07 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