Results 1 to 3 of 3
  1. #1
    Etoimos is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    249

    Help with DLookup


    I want to lookup the value in the Lab fieldof the RunResultData table and return that value based on the combobox DSRExecutionDate on the DSR form where it matches the ExecutionDate in the RunResultData table.

    I tried this code, but it is not working:
    Code:
    =DLookUp("Lab","RunResultData","ExecutionDate=" & [DSRExecutionDate])
    What am I doing wrong?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    delimiters
    strings need quote delimiters
    dates use #
    numbers don't use them

    =DLookUp("Lab","RunResultData","ExecutionDate=#" & DSRExecutionDate & "#"])

    also
    use brackets for query fields,
    form objects just use the object name : txtBox or me.txtBox

  3. #3
    Etoimos is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    249
    Thank you. I knew about the # sign, I just forgot And that is good info about the use of brackets.

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

Similar Threads

  1. Help with DLookup
    By shadowhawk in forum Access
    Replies: 2
    Last Post: 09-05-2016, 07:26 AM
  2. DLookup help
    By cshipley83 in forum Forms
    Replies: 2
    Last Post: 08-18-2016, 06:34 AM
  3. DLookup
    By aviscomi in forum Access
    Replies: 3
    Last Post: 05-23-2016, 10:03 AM
  4. Shortening if / dlookup >0 / then dlookup
    By Jack Russel in forum Modules
    Replies: 1
    Last Post: 02-19-2016, 03:01 PM
  5. DLookup help
    By denners05 in forum Access
    Replies: 1
    Last Post: 06-11-2011, 12:55 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