Results 1 to 7 of 7
  1. #1
    adams77 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    16

    Access Lookup (Unbound) field in Form

    I am receiving an error #Name? on a Form when trying to do a lookup from a customerid (perno) field.
    I would like to enter a CustomerID on a form, the results after entering the CustomerID would pull the FName & LName from the tblSeniority. However, I am receiving an error. I have inserted 2 unbound text boxes on the form. I have placed the code in the Control Source: =DLookUp("FName",[tblSeniority],"Perno" & [Forms]![frmPending]![txtPerno] & "").

    I am using MS Access 2010

    Can you take a look at this and give me some direction.

    Should I not put it in the control source and do son VBA?

    Thank you in advance for all your help!

  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,652
    For starters, the table argument must also be in quotes. You also need an equals sign:

    http://access.mvps.org/access/general/gen0018.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    And be sure to note the different syntax, based on whether the field Perno is Text or a Number.

    Linq ;0)>

  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,652
    Quote Originally Posted by Missinglinq View Post
    And be sure to note the different syntax, based on whether the field Perno is Text or a Number.
    The link doesn't make that clear enough?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Never know. I just went through interaction with a poster where they had explicit example for code and still messed it up.
    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.

  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,652
    So wait and see if that happens. Why repeat what's already been said if the OP hasn't responded that they're having trouble with it?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    adams77 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    16
    Thank you for giving me direction to the code! It worked just like i was hoping it would! Thanks again for all you do!

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

Similar Threads

  1. Replies: 5
    Last Post: 01-30-2015, 02:45 PM
  2. Connecting Unbound Field to Form
    By hithere in forum Forms
    Replies: 1
    Last Post: 09-04-2013, 11:56 PM
  3. Form unbound field control problem?
    By justphilip2003 in forum Forms
    Replies: 22
    Last Post: 04-18-2013, 03:39 PM
  4. Replies: 1
    Last Post: 11-05-2012, 11:26 PM
  5. Replies: 6
    Last Post: 12-01-2010, 06:52 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