=Environ("username")

jrjr

A work in progress
Local time
Today, 15:04
Joined
Jul 23, 2004
Messages
290
I have a form in my program that users fill out and submit. This is located on a windows server and they access it over our network. For the field 'requestor' I have =Environ("username") entered in the default value in the data field. This works well for all but one user and there are around 30 other users that work ok.

The rest of the program works fine but it does not pick up her network log in name. This is there instead- #name? The program was working fine untill her pc crashed one day and our dp department imaged another users machine and placed it on hers. I checked the other users machine and it does not work on that one either but she does not use this program. Since that time, they have reinstalled access but the results are the same with the =Environ("username") field. What else could we check out?
Thanks!
 
My program was written with 2000 and I am not sure what they installed last. Its either 2000 or 2003. My guess would be 2000. I have tested with access 2003 in the past and it worked ok. Sorry for leaving that out!
 
I got to wondering why I had the = in there so I changed
=Environ("username")
to
Environ("username")
Still not working for the one user but works for others
 
Well, does anyone at least agree with me that its a problem with the users machine?

Edit:
I found out that the machine in question has win 2000 as the OS and they have uninstalled and reinstalled office 2000. This sounds to me like some sort of a security setting within the OS not allowing any info to be let out. For now what I have done is made that field unlocked so the user can edit the #name? and enter in her own info. Not what I want but it will do for now until we get this sorted out.
 
Last edited:
Check the PCs references. Are any missing? If so, fix it. If not, try deselecting the references [one at a time] and then reselecting them to force Access to refresh the references.
 
I have successfully use Environ as both a default value and a module, for multiple usernames. Environ is supposed to work on the OS level to get all kinds of data. I would check and see how the user is logging onto the network and check his account on the sever, check the workgroups and permissions. hth.
 
The references are installed along with Access am I correct? I could copy the program to her computer and open it up there and check the references. That way I will not disturb any other users on the network. Ok, will do. Thanks!

Quest4:
I dont think any of that has changed but I will check it out. Thanks!
 
Last edited:
A programer at Boeing explain it to me once and she told me that environ was a system command and it dated way back to the days of DOS. How true that is I am not really sure, but everything else she told me was 100% correct. That is why I mentioned to look at the users account up on the sever, and make sure she is loggin on with a valid login, not something like guest. Also check out the permissions of the directory and the workgroup that own's the directory. Maybe there is no execute for that workgroup or something like that. hth.
 
jrjr said:
The references are installed along with Access am I correct? I could copy the program to her computer and open it up there and check the references. That way I will not disturb any other users on the network. Ok, will do. Thanks!

Quest4:
I dont think any of that has changed but I will check it out. Thanks!
Weird things can happen when a mdb is opened on a computer other than the one it was designed on.
 
That way I will not disturb any other users on the network.
Sounds like your db is not split? Each user should have a copy of the front end on their hard drive and the front end should be linked to the back end [shared data tables] on your network.
 
Actually what I am working with is a maintenance program that our county purchased. I developed a small program for users to submit work orders to our department and to review outstanding or completed orders. My program has linked tables with the main program. It has been working very well for 8 months or so until this trouble occured. Rather than trying to catch up with so many different users over 3 different shifts to install a program, I placed it on the server and e-mailed the link to them. So far there is only one complex on line with this and another on the way. Each new building or complex added will have its own database and copy of the work order program with permissions set for the users to only their respective db's. Didn't get a chance to check the references today but I will do it in the morning. Another thought I had was that maybe the user is logging into the machine rather than the network... But DP should have caught that... should have anyway
 
Ok, no luck. I unchecked each reference and it did not refresh. I tried rebooting and ran into trouble with nic detection. Finally got through that but no luck with the dll files. They must be corrupted but you would think that a complete reinstall of office would have fixed that. That is of course if they actually uninstalled them first. I talked to our DP and they agreed to wipe the machine and reinstall from the ground up... OS, Office, and whatever else she has on the machine. She is going to need a new nic too.

I think it will be fine when they get done. Thanks for the ideas anyway.
 
You might want to replace that NIC. When they go, they just start spuing out grabage. Maybe that could be part of the problem, NIC aren't very expensive any more. hth.
 
What happens when you run the below function? It will write all possible Environ values for that PC to the Immediate [debug] window.
Code:
Public Function PrintEnvironValues()
    
    Dim i As Integer
    For i = 1 To 9999
        If Len(Trim(Environ(i))) = 0 Then
            Exit For
        Else
            Debug.Print i & " = " & Environ(i)
        End If
    Next i
    
End Function
 
Thanks for the suggestion but unfortunately I already had my shot at it. Our DP dept has already agreed to wipe and reinstall so thats it for me. I do not work for that dept and have to walk a thin line on what I do on pc's around here. I am already pushing the envelope by doing programming out of title but at least its getting done and in our departments best interest. My current title does not include computer work but since I do development on my own, I was given the task to do along with deployment of the main program county wide. Hopefully in the future there will be some changes in titles. We are due. I do web developmant, run my own web server, design in html, asp, flash, java script and others. Lately I have been working with Access and VB code. Just not enough hours in a day ya know? Anyway thanks again, this site has been incredible in the amount of resourses and knowledge available and I would not be as far along as I am now if it werent for the efforts of all the people that contribute here.
3 Cheers!
 

Users who are viewing this thread

Back
Top Bottom