Question Autofill login username in a new record.

ktran4

New member
Local time
Yesterday, 23:10
Joined
Feb 27, 2016
Messages
8
Hello,

I spent a lot of hours searching for How to autofill the User name when a new record is created. I have an New Order form, EmployeeAccess form with UserID(Primary key) and Username.

When the New Order Form open, I want the Sale Person name autofill the name of the user opening that form. Your help is greatly appreciated.

Warm Regards,
KTran
 
create a public variable in a module. or create a Tempvars.

Public gstrCurrentUserName As String

now on your login form, set this variable to the UserName of your db, ie:

gstrCurrentUserName = Me.textUser

and on your new order form, set the Default Value of the textbox to gstrCurrentUserName.
 
Thank you so much, Sir! I am not a programmer. I hope I can follow your direction.

Best regards!
 

Users who are viewing this thread

Back
Top Bottom