Good day
I created a database in Access 2010 and now after opening it in Office 365 i found some of the functions previously done not working properly. I would be happy if I can get some help sorting out my problems.
1. I would like to display the current user of the database based on the person's User Login and not the Environ (computer's name). The fields in my table are User Name, User Login, Password, User Security. Below is the code i currently have
2. I am interested in having a field on the data form / datasheet auto populate and save with the name of the person inputting the information.
I created a database in Access 2010 and now after opening it in Office 365 i found some of the functions previously done not working properly. I would be happy if I can get some help sorting out my problems.
1. I would like to display the current user of the database based on the person's User Login and not the Environ (computer's name). The fields in my table are User Name, User Login, Password, User Security. Below is the code i currently have
Code:
Private Sub Form_Load() Dim Security As String Me.TxtUser = Environ("UserName") If IsNull(DLookup("UserSecurity", "tblUser", "[UserLogin] = '" & Me.TxtUser & "'")) Then MsgBox "No User Security set up for this user. Please Contact Admin", vbOKOnly, "login info" Me.CmdAdmin.Enabled = False Else Security = DLookup("UserSecurity", "tblUser", "[UserLogin] = '" & Me.TxtUser & "'") If Security = "Admin" Then Me.CmdAdmin.Enabled = True Else Me.CmdAdmin.Enabled = False End If
Comment