Results 1 to 3 of 3
  1. #1
    prs312 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Aug 2014
    Posts
    11

    Post DLookup on calculated feild

    I'm having trouble linking (via the DLookup function) a calculated field from one table to a lookup table in another table:
    -tblEQ5D has a calculated column EQ5D_HealthState that is the concatenation of the 5 input fields (e.g. 3, 2, 3, 3, 3, becomes 32333)
    -this value relates to a “US_Utility” value found in tblEQ5DLookup (e.g. in the lookup table value 32333 correlated to a US_Utility value of 0.616)


    - I want to Add a column in a query (qryEQ5D) that shows the Utility value for the EQ5D_HealthState value
    -I tried using the following but havent been able to get this to work: Utility: DLookUp("US_Utility","tblEQ5DLookup"," HealthState_ValueSet = [EQ5D_HealthState] ")

    - I also tried relating the two fields in the database relationships but get an error stating that calculated fields can't be apart of relationships :/

    See below image for clarification:

    Click image for larger version. 

Name:	DB issue pic.png 
Views:	10 
Size:	86.8 KB 
ID:	19077

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Part of the problem is the dynamic parameter is within quote marks. Also, different data types.

    Try:

    DLookUp("US_Utility", "tblEQ5DLookup", "HealthState_ValueSet =" & Val([EQ5D_HealthState]))


    Make HealthState_ValueSet a text field and then instead of DLookup, try joining the two tables in a query.
    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
    prs312 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Aug 2014
    Posts
    11
    That worked! thanks a lot June7

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

Similar Threads

  1. Updating a feild in a table from a Query
    By Tuckerbox2081 in forum Access
    Replies: 4
    Last Post: 01-08-2014, 09:11 PM
  2. Count Feild
    By Curtis Moxam in forum Database Design
    Replies: 2
    Last Post: 11-08-2013, 10:18 AM
  3. Replies: 3
    Last Post: 12-09-2011, 11:55 AM
  4. To feild in send object from Form
    By forrestapi in forum Forms
    Replies: 16
    Last Post: 07-29-2010, 03:05 PM
  5. Replies: 4
    Last Post: 03-05-2010, 09:56 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