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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'Undefined Function "Environ" in Expression' Message

Status
Not open for further replies.

jt643

Technical User
Jun 17, 2003
144
My database has been working fine until this weekend. I utilize the following code to extract records from a temp table:

UserID = Environ("USERNAME")

Now, I am getting errors saying either "Undefined Function 'Environ' in Expression", when in the form view.

I used to be able to hover my cursor over the code above while debugging and it would tell me what my UserID equalled, but now it is almost as if VB doesn't recognize that code anymore.

I have not altered the code or Microsoft Access at all lately. I have only been working on a beta on my local machine, and this is the server production version.

Help!

Thanks in advance.
 
Have you checked the references (menu Tools -> References ...) ?
You may also try this:
UserID = VBA.Environ("USERNAME")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks PH.

I did read in some other posts the suggestion to check the references. They suggested looking for 'missing' links. None of my references that are checked are designated as 'missing' or anything of that nature.

In addition, I tried the 'VBA' before 'Environ', but it did not fix it.

I think there may be an issue with a recent update to the references, but I do not know how to check that.
 
I have determined it has to do with my Visual Basic for Applications reference. I don't know if a recent update changed something. It is only occuring on one machine.

I uninstalled and then installed Office, but it is still giving me issues.

I noticed there are other VB for Apps references available, but they won't let me choose them as they say there is a name conflict when I click 'OK'.

I checked it against a machine that is working, and all the references are the same - same version, same description, same priority, etc...
 
Have you the same problem in the brand new database ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
After a recent test and a 'compact and repair database', it seems to be working.

Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top