DLookup

Dumferling

Member
Local time
Today, 17:05
Joined
Apr 28, 2020
Messages
102
I cannot see what is wrong with this: vblUpdatedBy = DLookup("[FullName]", "tblAUsers", vblUser)

The variable (vblUser) is defined as a String and picks up its value from a function (fOSUser) which give the username. It has this correctly as DKNIGHT (text). The DLookup function is finding the full name of the user (FullName) in tblAUser but it produces an error 2471 The expression you entered as a parameter produced this error: "DKNIGHT".

I can't see what the issue could be
 
Try: = DLookup("[FullName]", "tblAUsers", "UsernameColumnName='" & vblUser & "'")
 
See the examples in my signature but you aren't comparing your vblUser to anything

vblUpdatedBy = DLookup("[FullName]", "tblAUsers","YourUserColumnNameGoesHere = '" & vblUser & "'")

Edit - damn faster fingers.... @pisorsisaac@gmail.co
 
Great. So I need to tell it which column to look in. Works now. Thanks very much
 
Minty and I were glad to help, good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom