Current User association

H

HenryJD

Access 2003: I am using the module from http://mvps.org/access/api/api0008.htm
to obtain the current user. This works great. But it returns the 'coded'
login DomainName assigned by the employer for the individual to enter when
logging in. It is not the individuals actual name. Currently we have a form
that displays the 'coded' fOSUserName. We would like to have the individual's
actual name on the form instead. I have a table listing the DomainName (same
as fOSUserName) in one column and the individual's name in another column.
How do I create a string, say 'User', that is dependent on the fOSUserName? I
would then simply substitute 'User' for 'fOSUserName' in the form and I would
be the hero. Of course, credit will be given to whoever replies with a
solution.
 
R

RonaldoOneNil

Use a DLookup

=DLookup("User","YourTableName","DomainName = '" & fOSUserName & "'")
 
H

HenryJD

Looks like this might work. I am a novice at Modules, so to get the
fOSUserName to work I simply copied it and pasted it into a new module. I'm
not sure exactly what to do with your suggestion. My table is called
'tblPOC'. The column with the individuals names is called 'POC'. The column
that matches fOSUserName is 'DomainName'. The term 'User' does not exist
(yet?). And I'm not sure about setting dimensions, etc. Should your DLookup
go in the existing module or in a new one? I really appreciate your help. My
guess is 2 more back-and-forth sessions before I understand what to do.
Thanks again.
 

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