Query Criteria Dlookup

jmaty23

Registered User.
Local time
Today, 06:45
Joined
Jul 24, 2012
Messages
53
I am trying to run a query and filter it by the current authorized user id in my database.

Code:
=DLookUp("property","tblwoOption","[userid] = #" & auth.userid & "#")

auth.userid is in a class module that should show the current user id number and for some reason it isn't working. When I try to run the query, the Enter Parameter Value box shows with auth.userid. Is it possible to call these in query criteria's?
 
jmaty23, you have enclosed the criteria with ## which is normally used for Dates.. so try this..
Code:
=DLookUp("property","tblwoOption","[userid] = " & auth.userid)
 
I copied what you said it should be and the query changed it to this:

Code:
=DLookUp("property","tblwoOption","[userid] = " & [auth].[userid])

When I try to run the query, I still get the Enter Paramater Value box.
 

Users who are viewing this thread

Back
Top Bottom