Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2010
    Posts
    13

    Unanswered: DLookup Syntax issue

    Hi all,

    Just having a DLookup issue and I can't figure out why.

    This query runs pefectly:
    strOrig = DLookup("[RoleName]", "Role", "[RoleID] = 224")

    However when I want to search for the ID in a particular field, my strOrig results in "".
    strOrig = DLookup("[RoleName]", "Role", "[RoleID] = '" & RoleID.Value & "'")

    Any ideas why? The RoleID is an auto increment field, but I didn't think that would make a difference.

    Thanks!

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    This should help:

    General: DLookup Usage Samples

    You're using the string syntax instead of the numeric syntax.
    Paul

Posting Permissions

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