currentuser() ??????

G

Guest

The =currentuser() worked on Friday I thought, but today, went to let people
test it, and it backfired on me... my form is now based on the following
query SELECT employee.* FROM employee WHERE
(((employee.UserID)=CurrentUser())); but the query is not even pulling my
name as am logged in.
tbl employee contains employee information including userID which Is their
LAN login---- I manually input this in the table, is there something am
missing or why is it not pulling anyone name?

OJ!
 
J

Joan Wild

JOM said:
The =currentuser() worked on Friday I thought, but today, went to let
people
test it, and it backfired on me... my form is now based on the following
query SELECT employee.* FROM employee WHERE
(((employee.UserID)=CurrentUser())); but the query is not even pulling my
name as am logged in.
tbl employee contains employee information including userID which Is their
LAN login---- I manually input this in the table, is there something am
missing or why is it not pulling anyone name?


The CurrentUser() function returns the Access username, not the LAN
username. If you didn't implement security in Access, then it will always
return 'Admin'.

If you did implement security, then your table needs to have their Access
usernames not LAN usernames.

If you haven't/don't want Access security, you can use the following
function to get their network username.
http://www.mvps.org/access/api/api0008.htm
 
G

Guest

How ill Incorporate it with my form..... My form does not have any access
security level, all it does have is employee information including there LAN
Login... What I want them to be able to do is to open that form and only
display there information only... I put the code that you suggested but its
opening the name of the first employee in the database.... which is obviously
wrong... Please help!

OJ!
 
J

Joan Wild

JOM said:
How ill Incorporate it with my form..... My form does not have any access
security level, all it does have is employee information including there
LAN
Login... What I want them to be able to do is to open that form and only
display there information only... I put the code that you suggested but
its
opening the name of the first employee in the database.... which is
obviously
wrong... Please help!

What is the SQL statement of the query that the form is bound to?
 
G

Guest

my query is as follows ********** SELECT employee.* FROM employee WHERE
(((employee.UserID)=CurrentUser()));
 

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