Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

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

Status
Not open for further replies.

sparkbyte

Technical User
Sep 20, 2002
879
US

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

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

How can I get the GUID Value??

Thanks

John Fuhrman
 
What GUID ?

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

Have fun.

---- Andy

There is a great need for a sarcasm font.
 
Finally got it after fighting with it for 3 days!!!!!

Code:
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
    Else
        Debug.Print "Could not get the UserID assigned to the active case."
    End If
           
End Sub

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



Thanks

John Fuhrman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top