Username linked to a full name?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What I want to do is associate usernames from the login of the database to
each person's real name for the purpose of comparing it to a control
somewhere in the database. I have everyone's user name from the network
login and I want that name to be associated with their full name. I have
everything else set up to compare them.
(eg. Username:jsmith to be recognized as John Smith to compare it to a
control for the supervisor of an area and only give him editing permissions.)

Thanks
 
What I want to do is associate usernames from the login of the database to
each person's real name for the purpose of comparing it to a control
somewhere in the database. I have everyone's user name from the network
login and I want that name to be associated with their full name. I have
everything else set up to compare them.
(eg. Username:jsmith to be recognized as John Smith to compare it to a
control for the supervisor of an area and only give him editing permissions.)

Thanks

This is more a coding issue than one of Access ULS, but basically you
would write a function that returns your FullName. This assumes you
have a table which stores this information (I've named it
tblUserNames):

Function GetFullName (ByVal UserName As STring) As String

Dim rst As ADODB.Recordset

Set rst = New ADODB.Recordset
rst.Open "SELECT strFirstName, strLastName FROM tblUserNames WHERE
strUserName='" & UserName & "'", CurrentProject.Connection

If Not (rst.eof And rst.BOF) Then
GetFullName = rst("strFirstName") & " " & rst("strLastName")
End If

rst.Close
Set rst = Nothing

End Function

Obviously you'll have to change the field and table names to match
your own, and add error and varialbe checkting to make this a complete
solution. This also assumes that you have a reference to the ADO
library.
 
Back
Top