Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2011
    Posts
    1

    Unanswered: DLookup Not working in

    Hi

    i am new to access and figuring it out.

    I created a Form with 2 Text boxes , one is unbound while the other is based on a field .
    In the Unbound field i have used the following function
    DLookUp("First_name","taskmaster","empid =" & [Forms]![workers]![workerid])
    where workerid is the name of the other field.
    This will display the names of the employees based on the Empid entered in the field called workerid.
    this works fine.

    Now i made this form as a Sub form in another Form called as Projects.

    Now it displays an error #Name ?

    Please kindly guide me on this

  2. #2
    Join Date
    Apr 2005
    Location
    Zagreb - Croatia
    Posts
    372
    Try these:
    ......=" & [Forms]![Projects]![SubformName]![WorkerID])
    Last edited by MStef-ZG; 09-20-11 at 09:16.

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    the usual cause for this is a typo / spelling mistake
    the compiler / run time agent is tellign you it cannot resolve the name of something.
    whart I'd suggest you do is open the form
    when the code stops it should switch to debug mode
    find what its complainging aboiut
    you should know the line it stopped on.
    then go through each eleemtn of the code on that line to enmsure that variable are set correctly

    my suspiscion is that the control is not called workerid in form workers or the formworkerid isn't visible isn't open when you try to call it. you will probably have to change the formname to say 'projects' assuming that form has the workerid on it
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •