Complex Environ question

M

MARK

This seems very complex to me but may be very simple to others. I work
with Access 2003 and have a NOVELL login. Because of that we have
S_User to identify our login ID.

I've put the following code in VBA so that I can try to identify the
user in my database without them having to select themselves.

Private Sub Form_Load()

employee_login_id = Environ("s_user")

End Sub

I have a table with the records showing Employee_login_id and Employee
name.

I have a form where the employee has to select their name and I want
them to be able to just see their name. How do I go from having a
table that contains records of employee ID and Employee name as well as
having the above code from our Network Administrators to getting what I
need?

Mark
 
O

OfficeDev18 via AccessMonster.com

Mark,

I'm confused. What is it you're missing? It seems to me you already have the
info you need. All you need on the form is a locked textbox that displays the
username, such as Me.txtUserID = Environ("S_User").

By the way, you can substitute a number for "S_User." If you experiment a
little, you can find out the various numeric arguments the Environ() function
takes, and you can pick and choose the one that's the most appropriate for
your needs. In my system, the number 29 is "USERNAME", which gives the user
login info.

Hope this helps,

Sam
 
M

MARK

What you gave me is exactly what I'm missing! I don't know how to get
it show up on the form.

Thank you!!!

Mark
 
M

MARK

I guess I spoke too soon.

I created a locked text box - simple. But I don't know where to put
Me.txtUserID = Environ("S_User").

Actually, my text box is named EmployeeName and in the Control Source I
put:

EmployeeName = Environ("S_User")

I get #Name? I have checked that my name is in the list of employees
to ensure that the problem isn't because it is looking for my user ID!

Any help is appreciated.

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top