Results 1 to 3 of 3
  1. #1
    Gina Maylone is offline Always learning
    Windows 10 Access 2016
    Join Date
    Jun 2013
    Location
    Afton, MN
    Posts
    544

    dlookup issue

    Hello!

    I am attempting to lookup the date an employee attended a training event, from within a subform. Main form: Employees, Subform: EmployeesRequiredTraining, Query where I'm trying to get data from:EMPLOYEEATTENDANCE. My lookup statement:
    Code:
    =DLookUp("eventdate","EMPLOYEEATTENDANCE","[EmployeeID] & "=[Forms]![Employees]![EmployeeID]) And ([EventID]=[EventID])
    . It returns blank. At one point it returned -1, and another point 12/1/1899. Can't remember what I had changed to get those.



    What am I missing? TIA!

    P.S. Not sure if it matters, the form I'm trying to lookup from is a continuous form.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    The & and = signs are in each other's position, extra parens, and also need to concatenate the EventID phrase.

    =DLookUp("eventdate","EmployeeAttendance","[EmployeeID] = " & [Forms]![Employees]![EmployeeID] & " And [EventID]=" & [EventID])

    If there is no match will return Null.

    Suggest you not use ALLCAPS in naming convention. It is harder to read.
    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
    Gina Maylone is offline Always learning
    Windows 10 Access 2016
    Join Date
    Jun 2013
    Location
    Afton, MN
    Posts
    544
    Quote Originally Posted by June7 View Post
    The & and = signs are in each other's position, extra parens, and also need to concatenate the EventID phrase.

    =DLookUp("eventdate","EmployeeAttendance","[EmployeeID] = " & [Forms]![Employees]![EmployeeID] & " And [EventID]=" & [EventID])

    If there is no match will return Null.

    Suggest you not use ALLCAPS in naming convention. It is harder to read.
    THANK YOU JUNE! Worked perfectly! Have an awesome day!

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

Similar Threads

  1. DLookup Issue
    By sdel_nevo in forum Programming
    Replies: 10
    Last Post: 05-18-2013, 08:51 AM
  2. DLookup issue
    By Alex Motilal in forum Programming
    Replies: 7
    Last Post: 04-17-2013, 12:41 PM
  3. Dlookup issue
    By Gilgamesh in forum Forms
    Replies: 5
    Last Post: 12-22-2012, 10:26 PM
  4. Dlookup issue
    By brharrii in forum Programming
    Replies: 3
    Last Post: 06-22-2012, 07:08 PM
  5. DLookup issue
    By seth1685 in forum Programming
    Replies: 5
    Last Post: 01-12-2012, 08:55 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