Results 1 to 3 of 3
  1. #1
    riocobre is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Mar 2017
    Location
    Pennsylvania
    Posts
    2

    DLookup not working,HELP!!

    On my form I have the following:



    1. A combox (named Combo85) that has a look up to one column in a table (table name is EmployeeInfo); This is working properly
    2. I have a textbox (text93). The control source for this box is the expression =[Combo85]; This is working properly, I get the first cell in whichever row step 1 provides.
    3. I have another textbook (text95). The control source for this is =Dlookup("[EmpUnit]","EmployeeInfo]","[EmployeeNumber] = ' " & [text93] & " ' ")

    When I start the form I get "#Error" in the text95 box.

    if I change the Dlook in text95 to =Dlookup("[EmpUnit]","EmployeeInfo]","[EmployeeNumber] = 522426 ") it works properly

    Practically all the examples that I see uses numbers.

  2. #2
    riocobre is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Mar 2017
    Location
    Pennsylvania
    Posts
    2
    Sorry,

    I should have check the forum before I posted my question. I saw that it was already answered. Now it is working.

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You should really Copy and Paste and code. Typing it again can introduce errors that are not in the original code.
    Try this line: =Dlookup("EmpUnit","EmployeeInfo","EmployeeNumber = " & Me.text93 )

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

Similar Threads

  1. DLookup not working
    By Lou_Reed in forum Access
    Replies: 29
    Last Post: 03-13-2017, 01:25 PM
  2. DLookup not working for form
    By ndehhh in forum Programming
    Replies: 6
    Last Post: 10-15-2015, 02:38 PM
  3. Dlookup not working
    By shaunacol in forum Forms
    Replies: 8
    Last Post: 06-12-2015, 09:28 AM
  4. Dlookup not working in Subform
    By keiath in forum Forms
    Replies: 1
    Last Post: 04-23-2014, 09:03 AM
  5. DLookup isn't working
    By cec in forum Access
    Replies: 7
    Last Post: 12-28-2012, 12:21 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