Results 1 to 4 of 4
  1. #1
    dudeitsme is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Aug 2019
    Posts
    6

    DLookup with Multiple Criteria returning an Error

    I'm building a report that has monthly metrics to track performance. I'm having an issue with a DLookup field.
    The field should match the AgentID and the Date fields. I verified that the Agent ID and Date fields match on the tables.

    Here's my query, but it only returns an error message.



    Code:
     AHT Seconds: DLookUp("AHT_Seconds","tblAHTDaily","[AgentID_AHT] =" & [AgentID_Unplanned] & "' And [AHT_Date] = '" & [Unplanned_Date] & "'")

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Date fields require #(pound/hash/octothorpe) delimiters.
    If AgentID is numeric data type then no ' required.
    TRY---(untested)
    Code:
    AHT Seconds: DLookUp("AHT_Seconds","tblAHTDaily","[AgentID_AHT] =" & [AgentID_Unplanned] & " And [AHT_Date] = #" & [Unplanned_Date] & "#")
    Good luck.
    Last edited by orange; 10-15-2020 at 04:33 PM. Reason: spelling

  3. #3
    dudeitsme is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2019
    Posts
    6
    That worked perfectly! Thank You.

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    You are welcome. Continued success with your project.

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

Similar Threads

  1. Dlookup returning #Error
    By Perfac in forum Programming
    Replies: 2
    Last Post: 04-08-2020, 09:31 PM
  2. DLookup Multiple Criteria (Data type error)?
    By sergi117 in forum Access
    Replies: 5
    Last Post: 09-18-2018, 03:55 AM
  3. DLookup returning #Error
    By apk19 in forum Forms
    Replies: 8
    Last Post: 12-15-2015, 03:26 AM
  4. Replies: 3
    Last Post: 08-08-2012, 08:04 AM
  5. Dlookup returning #Error
    By ozziestockton in forum Forms
    Replies: 4
    Last Post: 07-30-2012, 10:53 AM

Tags for this Thread

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