Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Looking up a GUID with DLOOKUP returns ?????????

Looking up a GUID with DLOOKUP returns ?????????

Looking up a GUID with DLOOKUP returns ?????????


Trying to figure out why DLOOKUP is not returning the GUID. The GUID displays properly in the txtbox field but DLOOKUP is not returning the GUID value.

From the VBA Editor window


?DLookup("[ActiveDirID_FK]", "Activity", "Activity_PK = " & 76)

How can I get the GUID Value??


John Fuhrman

RE: Looking up a GUID with DLOOKUP returns ?????????

What GUID ?

Looks to me like you are trying to get the value of ActiveDirID_FK field from Activity table where Activity_PK = 76
Based on this info

Have fun.

---- Andy

There is a great need for a sarcasm font.

RE: Looking up a GUID with DLOOKUP returns ?????????

Finally got it after fighting with it for 3 days!!!!!


Private Sub Form_Current()
'On Error Resume Next

Dim strCaseLoginID As String
Dim varActiveDirID_FK As Variant

    varActiveDirID_FK = StringFromGUID(Me.txtbx_ActiveDirID_FK)
    varActiveDirID_FK = Right(varActiveDirID_FK, Len(varActiveDirID_FK) - 6)
    varActiveDirID_FK = Left(varActiveDirID_FK, Len(varActiveDirID_FK) - 1)

    If Len(varActiveDirID_FK) <> 0 Then
        Debug.Print "varActiveDirID_FK = " & varActiveDirID_FK
        strCaseLoginID = DLookup("[UserID]", "ADusers", "ActiveDirID = " & "'" & varActiveDirID_FK & "'")
        Debug.Print "strCaseLoginID = " & strCaseLoginID
        Me.txt_UserLogon = strCaseLoginID
        Debug.Print "Could not get the UserID assigned to the active case."
    End If
End Sub 


CODE --> Output

varActiveDirID_FK = {52D549E0-06FC-4674-BF34-2BF16382C7F2} 


John Fuhrman

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close