query with dlookup

mseifman

New member
Local time
Today, 11:18
Joined
Oct 6, 2004
Messages
5
I am trying to run a query to filter records based upon the current user's department. I have the following criteria in my query:

DLookUp("[UserDepartment]","UserList","[LoginID ='" & CurrentUser & "'" ]")

I am receiving the following error:

The expression you entered contains invalid syntax. You omitted an operand or operator, you entered an invalid character or comma, or you entered text without surrounding it in quotation marks.

Can anyone give a hand on this? This Dlookup is new to me, and I've never done this type of query before.
 
Maybe like this... I haven't tested. [spaces added in statement for clarity]

DLookUp("[UserDepartment]","UserList","[LoginID =' " & CurrentUser & " ' ] " )

HTH :o
 
ms,

DLookUp("[UserDepartment]", "UserList", "[LoginID] ='" & CurrentUser & "'")

Brackets!

Wayne
 

Users who are viewing this thread

Back
Top Bottom