Update a User ID Field

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
 
R

RonaldoOneNil

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top