I have the following script which sets the currentuser, however it clears currentuser when I open the database and I don't want this, I want the currentuser to be there and it only changes when I want it to change.
I.e. when the database opens if no value is found in my table then the name stays the same, if a value is found in my table then it will change to that name.
The following script is to check if a value is in the table, I have tried adding this to the script that sets currentuser but the currentuser is stilled cleared upon opening the database due to the function..
this is at top of module
this is the function that I use
Set currentuser manually if I want to
I.e. when the database opens if no value is found in my table then the name stays the same, if a value is found in my table then it will change to that name.
The following script is to check if a value is in the table, I have tried adding this to the script that sets currentuser but the currentuser is stilled cleared upon opening the database due to the function..
Code:
Dim TableName As String
TableName = Nz(DLookup("CurrentUserID", "UserInfo"))
If TableName <> "" Then gblusername = TableName
this is at top of module
Code:
public gblusername as string
this is the function that I use
Code:
function currentuser as string
currentuser = gblusername
end function
Set currentuser manually if I want to
Code:
gblusername = "Jim"