Results 1 to 2 of 2
  1. #1
    tazui1982 is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Posts
    19

    Need help with Employee ID Dlookup VBA code

    VarFilter = "[Employee ID]= #" & Forms!DateTimeDLookup!txtEmployeeID & "#"

    I'm having trouble with EmployeeID Dlookupfunction. I want Access to show me employee's Last name and First name based on EmployeeID but in the video tutorial that I followed OP used Date of Birth instead, which is why there is "DateTimeDlookup", my EmployeeID field is "ShortText".
    What should I have instead of DateTime (infront of Dlookup)


    Thanks in advance.

  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,902
    If Employee ID is a text type, use apostrophe instead of # as delimiter - # is for date/time type, number type does not require any delimiters.

    Your form is named DateTimeDLookup? Use whatever the name of your form is.

    Advise no spaces in naming convention. Better would be Employee_ID or EmployeeID.
    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.

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

Similar Threads

  1. Replies: 15
    Last Post: 05-12-2017, 04:09 AM
  2. Replies: 2
    Last Post: 05-09-2017, 04:12 PM
  3. Indexing (no dupes) dates where employee code = XXXX
    By snipe in forum Database Design
    Replies: 4
    Last Post: 12-12-2013, 03:19 PM
  4. Replies: 8
    Last Post: 06-06-2012, 12:28 PM
  5. Vba dlookup code help!
    By amsmakkah in forum Programming
    Replies: 1
    Last Post: 07-19-2011, 09:38 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