Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    jcaptchaos2 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Apr 2011
    Posts
    36

    Dlookup help

    Ok I am new here 1st post need help as I have been unsuccessful at my other board, I am trying to use Dlookup to add the "shift" to one of my tables, here is my code
    Code:
    =DLookUp("[Shift]","[employeelistingjac]","[EmployeeNumberr] = '" & [Forms]![Payroll_Time_on]![EmployeeNumber] & "'")
    I get "#Name?" in the combo box.



    Hope to get some help

    Thanks JC

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What is the data type of EmployeeNumberr in the table (and does the field really have 2 r's)?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    jcaptchaos2 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Apr 2011
    Posts
    36
    Thanks for responing, sorry I caught that after I posted her is my new code but still get the sane error and the the field is (number)

    Code:
    =DLookUp("[Shift]","[employeelistingjac]","[Employee Number]= '" & [Forms]![Payroll Time on]![Employee Number])

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If it's a numeric field, you don't want that single quote before the value.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    jcaptchaos2 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Apr 2011
    Posts
    36

    I tried it

    That does not seem to make a difference

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Can you post the db?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    jcaptchaos2 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Apr 2011
    Posts
    36
    How do I do that? I will do anything to get this working

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Compact/repair and then zip, then attach in the advanced reply area using the Manage Attachments button.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    jcaptchaos2 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Apr 2011
    Posts
    36
    I found it, my form name was wrong, just needed a good night sleep and then to re-look at it, Thanks for your help

  10. #10
    jcaptchaos2 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Apr 2011
    Posts
    36
    Bot now have another question, it does bring the result up in the combo box that I want but then I get an error I think when it trys to send it to the table or an it says error in the combo box. I need the result to be placed in the shift column in the employee listingjac table

  11. #11
    jcaptchaos2 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Apr 2011
    Posts
    36
    Here is the DB

  12. #12
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Which form? What are the steps to recreate the problem?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  13. #13
    jcaptchaos2 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Apr 2011
    Posts
    36
    Paroll time on form - I would like the shift which is the DLOOKUP to be stored in the Paroll time on table

    Thank you

  14. #14
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Ah; you want to take the DLookup out of the control source of that textbox and change it to the shift field. That binds the textbox to the table. In the after update event of the employee number textbox, set the value of the shift field with the same DLookup. It looks like you were trying to do that, but you have it in the after update event of the shift textbox.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  15. #15
    jcaptchaos2 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Apr 2011
    Posts
    36
    Ok thank you I will give that a try

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. DLookup
    By neil45156 in forum Forms
    Replies: 1
    Last Post: 04-11-2011, 11:31 AM
  2. dlookup help
    By gsantacruz in forum Programming
    Replies: 9
    Last Post: 10-11-2010, 11:46 AM
  3. DLookup()
    By jgelpi16 in forum Programming
    Replies: 2
    Last Post: 09-15-2010, 07:20 AM
  4. Need help with dlookup.
    By Keith in forum Database Design
    Replies: 8
    Last Post: 05-24-2010, 06:28 PM
  5. Dlookup??
    By Vikki in forum Access
    Replies: 4
    Last Post: 02-16-2010, 07:59 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