• the Dreaded DLookUp (XP)

    Author
    Topic
    #434096

    I just can’t get the syntax right, trying to look up a text field to return the long integer ID – here’s where I’m up to –
    lngAtt_ID = DLookup(“Att_ID”, “tblAttendees”, “External_ID = “””” & strExternal_ID & “””)
    External_ID is a unique text field. What am I getting wrong?

    Now I’ve got it – lngAtt_ID = DLookup(“Att_ID”, “Attendees”, “External_ID = “”” & strExternal_ID & “”””) – Hooray!

    Viewing 0 reply threads
    Author
    Replies
    • #1022767

      BTW, when you are trying to embed quotes in a string, you might find it easier to read if you tried embedding a single-quote rather than a double-quote.

      So instead of:   lngAtt_ID = DLookup("Att_ID", "Attendees", "External_ID = """ & strExternal_ID & """") - Hooray!
      
      you would have:  lngAtt_ID = DLookup("Att_ID", "Attendees", "External_ID = '" & strExternal_ID & "'") - Hooray!
    Viewing 0 reply threads
    Reply To: the Dreaded DLookUp (XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: