Display username

Kaybaj

Registered User.
Local time
Today, 16:38
Joined
Apr 15, 2010
Messages
67
Please i have created a password login form where users can login to the application. what i want to do is that when a user logs in with something like this "chris.james" as the username then the username or the full names of the user should be displayed on a form probably the form that opens after the login password form.
i'll appreciate any help

thanks
 
You can use a DLookup and store the username in a label or text field.

Use the form on Open event add a label or text box,

I take it you have a table which holds the usernames so use the DLookup to return the user name.
 
Look at "DemoUserNameA2000.mdb" (attachment, zip).
Open "MainForm" and try.
Try to enter a new record.
Look at Table1, forms (VBA).
 

Attachments

i can't seems to understand because it's only 'Mstef' that keeps on showing in the text box please explain more
 
Please find attached my "login form" and a "switchboard" you can explain with this
thanks
 

Attachments

Not sure if this helps but in my database, I created an employee table which holds the persons NT username, full name and email address
I then do a dlookup to find the full name based on the NT name

Dim strNetworkID As String
Dim intEmployeeID As Integer
'Takes the username from windows and finds the full username from the employee table
strNetworkID = GetUserName()
intEmployeeID = DLookup("EmployeeID", "tblEmployees", "NetworkID='" & strNetworkID & "'")
Me.CurrentUser = DLookup("EmployeeName", "tblEmployees", "NetworkID='" & strNetworkID & "'")
 
thanks i'll try that, but what if the user does not have user domain on the system windows that means his identity cannot be uncovered he or she can just use anybody's windows right to do whatever..
 

Users who are viewing this thread

Back
Top Bottom