please try this Dim GETLOCATION as string gstrLocation = "" & DLookup("Location", "UserTable", _ "User = '" & Environ("USERNAME") & "'") GETLOCATION = "" & gstrLocation
----- Original Message ----- From: eliotchs To: ms_access@yahoogroups.com Sent: Tuesday, September 27, 2005 3:11 PM Subject: [ms_access] runtime error 94 Invalid use of Null ?? Hi, I'm using the following code to assign a location to the user logged in based on a usertable Dim GETLOCATION gstrLocation = DLookup("Location", "UserTable", _ "User = '" & Environ("USERNAME") & "'") GETLOCATION = gstrLocation The problem is, I thought if I gave the user no location then they would get all location, but instead I get the above error, Any ideas would be great!! Thanks Joe ------------------------------------------------------------------------------ YAHOO! GROUPS LINKS a.. Visit your group "ms_access" on the web. b.. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. ------------------------------------------------------------------------------ [Non-text portions of this message have been removed] ------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/q7folB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/ms_access/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/