Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2011
    Posts
    11

    Unanswered: How to do a dlookup on a colmun that the critera might contain a % as the first char

    I am looking to do a dlookup that will look up the distingused name of the Role Goup on a table. The issue is that the Group name might be like %PWFMSDB and as we all know the % is a SQL wildcard. I have tried a replace fuction as illistrated below but it is not working(Probably incorrect syntax). Any Ideas?

    strUserDN = DLookup("[DistinguishedName]", "Admin_RoleGroups", "[GroupName] = '" & Replace(Trim(Me.cboRoleGroup.Value), "%", "'%") & "'")

  2. #2
    Join Date
    Nov 2011
    Posts
    11

    [Resolved]

    strUserDN = DLookup("[DistinguishedName]", "Admin_RoleGroups", "[GroupName] = '" & Replace(Trim(Me.cboRoleGroup.Value), "%", "%") & "'")

    Hopes this helps if needed in the future. Just had to take it out and add it back in the sameway so that it would ignore the % as a wildcard!

    I think thats what it does anyway but it worked. thanks for the time everyone!

Posting Permissions

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