Results 1 to 4 of 4
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097

    Can't find source of Error #2471

    A very simple DLookup:



    Code:
    varRetAddr = DLookup("[Address]", "QReunionRoster", "[LastName] = " & LN)
    varRetAddr dim'd as variant
    LN dim'd as string
    LN = "Barth" as seen in debug


    Error:
    Click image for larger version. 

Name:	000.jpg 
Views:	9 
Size:	22.5 KB 
ID:	30915

    QReunionRoster in fact contains a fields "LastName" and "Address" and the underlying query table in fact contains the name "Barth". I have no idea what the problem is? BTW I tried coding "LastName" with and without brackets.

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    after 840 posts, you must know about how to treat text and numbers when building a string

    "[LastName] = '" & LN & "'"

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    "OUCH" ................ duly admonished.

  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    Sorry, was a bit grumpy last night -

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

Similar Threads

  1. Replies: 4
    Last Post: 03-27-2017, 02:06 PM
  2. Runtime Error 2471
    By Thompyt in forum Programming
    Replies: 9
    Last Post: 12-29-2016, 04:56 PM
  3. Replies: 3
    Last Post: 04-27-2016, 01:25 PM
  4. Replies: 4
    Last Post: 01-13-2016, 02:04 PM
  5. Can't find source of errors
    By GraeagleBill in forum Programming
    Replies: 14
    Last Post: 01-20-2015, 06:45 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