Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Environ changes from 2002 to 2003 1

Status
Not open for further replies.

Maca2

Technical User
Joined
May 21, 2001
Messages
5
Location
GB
Hi,

I have a piece of code in Access 2002 DB that gets a network
users name and uses this in a query.

Environ("UserName").

But in Access 2003 i get an undefined function error
can you tell me what the code in 2003 is ?

Cheers
 
Seems you have the latest mdac SP and thus have problem with sandbox mode.
You may create your own function in a standard code module:
Public Function myEnviron(strVar)
myEnviron = Environ(strVar)
End Function

And now use myEnviron("UserName") in your query.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top