DLookUp

zyousafi

Registered User.
Local time
Tomorrow, 01:47
Joined
Jun 13, 2010
Messages
39
I am having some trouble with the DLookUp formula. It seems to be entered correctly; however I want to use either the CurrentUser() function or the WindowsNTUserID as my criteria (i.e. the third (3rd) part of the DLookUp formula. Can someone please help me here? Is this even possible?
 
@vbaInet

DLookUp("FieldName","TableName","CurrentUser()") or

DLookUp("FieldName","TableName","fOSUsername()") where fOSUsername() is a function defined in a module that retrieves the user's Windows NT User ID
 
You're almost there:
Code:
=DLookUp("FieldName","TableName","UsernameField = '" & fOSUsername() & "'")
 
May I ask what the significance of the aposterphe and quotations marks are? I am referring to the aposterphe and quotation marks around the fOSUsername() function. The code seems to be working great now...! Thank you very much for your help :)
 
You're welcome! :)

That is what you use when you are dealing with strings. For dates you use hash (#) and for numbers you don't use anything.
 

Users who are viewing this thread

Back
Top Bottom