Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    the Dreaded DLookUp (XP)

    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!

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: the Dreaded DLookUp (XP)

    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.

    <pre>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!</pre>

    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: the Dreaded DLookUp (XP)

    That is much easier to remember - thanks

Posting Permissions

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