access user autoname (1 Viewer)

dale_j1992

Registered User.
Local time
Today, 16:38
Joined
Sep 23, 2016
Messages
26
hello everyone, i have a small issue i need help with if, any help is much appreciated. i have a database in which i have a created a user log in function, i have it working too allow me too code what areas of the database you can see depending on authority levels i have set. However i have an area where i want the user to save there name against some data they have inputted, i have tried the environ method but it comes back with the username of the actuall PC not the access log on username, the pc is shared between operators on the shift with a generic mach.opps pc login, so i need too find a way of pulling this name automatically from the access log in, i am using access 2013 if this makes a difference. many thanks in advance :) regards Dale
 

static

Registered User.
Local time
Today, 16:38
Joined
Nov 2, 2015
Messages
823
maybe

CreateObject("WScript.Network").UserName
 

jdraw

Super Moderator
Staff member
Local time
Today, 11:38
Joined
Jan 23, 2006
Messages
15,386
You may want users to logon to your database/application rather than using some Environ variables.

Steve Bishop has a number of free Access vba videos on youtube.
This one may give you some ideas.

Good luck.
 

dale_j1992

Registered User.
Local time
Today, 16:38
Joined
Sep 23, 2016
Messages
26
many thanks for the helpful comments, you have prompted me too look at another solution. i have used this code me.inspector = forms!frmlogin!cbouser, i have tried multiple usernames an this inputs the user id into the textbox that ties in with the respective user who i logged in with, is there any way too display the name of the user instead of the Id, my system is set up with a login form, a user table and an authority level table. In my user table the user id is what i have managed too show in the autofill but i need the second column of the record which is 'Full name', is there any code where it will auto input the full name in place of the userid for the same record, ie userid = 21 but this is dave jones. kind regards
 

Users who are viewing this thread

Top Bottom