Results 1 to 4 of 4
  1. #1
    CurtisC is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2020
    Posts
    11

    using dlookup on report to get a cost from a table associated with another field in a report

    I have a table for equipment that lists the code, description and cost
    this equipment is used on calls that are entered on a form where the user can select the items used and enter the quantity
    on the report which gives the cost estimate for the job I have pulled in the equipment and quantity fields and im trying to put a field in for the per unit cost that is associated with the equipment used
    in the control source i have:



    =DLookUp([Equipment]![Unit_Cost],[Equipment]," [Equipment]![Item_Description] = " & [Report]![Equip_Used_1])

    but it asks me for a parameter value for Equipment and then displays #Error in the field under Cost Per

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    all the dlookup parameters are strings try

    =DLookUp("Unit_Cost","Equipment","[Item_Description] = '" & [Equip_Used_1] & "'")

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    remember, strings get quotes
    numbers do not:

    string:
    "[Item_Description] = '" & [Equip_Used_1] & "'"

    numeric:
    "[id]=" & txtID


  4. #4
    CurtisC is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2020
    Posts
    11
    you are awesome thx

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

Similar Threads

  1. Replies: 9
    Last Post: 07-03-2017, 11:24 PM
  2. Replies: 3
    Last Post: 01-18-2015, 06:05 PM
  3. Replies: 2
    Last Post: 03-07-2013, 04:50 PM
  4. Table with attachment field and report
    By Yaan in forum Access
    Replies: 0
    Last Post: 02-18-2011, 02:12 AM
  5. Table with attachment field and report
    By Yaan in forum Access
    Replies: 1
    Last Post: 02-13-2011, 07:01 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