Update a User ID Field

  • Thread starter Thread starter Duncs
  • Start date Start date
D

Duncs

I have a table with LogonID & UserName, and I want to populate a field
on my form with the User Name of the agent who is logged in.

I've used the code from Dev Ashish to get the logon ID however, what
I'm stuck at is how to populate the agents name field on the form,
with the UserName from the table based on the LogonID.

Make sense?

Can anyone help?

TIA

Duncs
 
If LoginID is Text set controlsource of your username field to
=DLookup("[UserName]","TableName","[LoginID] = '" & Me.LoginID & "'")

If LoginID is numeric
=DLookup("[UserName]","TableName","[LoginID] = " & Me.LoginID)
 
Back
Top