Populating Field with Logon Name

  • Thread starter Thread starter Jeff Dale
  • Start date Start date
J

Jeff Dale

I have a local Access database that I am sharing on my LAN.

We are running an AD environment.

What I would like to know is can I populate a field with the name of the
person that is making the entry in my database from a form.

This is an Access 2003 Database.

Thanks
 
One way you can do this is when the user logs in, put the name in an unbound
text field, on a hidden form. Then when you save the record, include a
reference to that form/field, and you have the user name.

Sharkbyte
 
Well I am not actually having them login to the database itself.

I am having them logon to the domain and was wondering if I can capture that
information without them having to enter anything. ( trying to make this as
foolproof as possible )


Thanks

JD
 
Well that's some nice code but where do I put it for it to be displayed.
 
Put the code in a module. (Do NOT name the module fOSUserName: modules
cannot be named the same as functions within them)

Use the function fOSUserName() to return the user Id anyplace you need it.
 
Doug,
I'd like to get the user name from our sql server logon. Sometimes the
windows logon is different than the sql logon. How would I accomplish this
task?
Thanks,
Tracey
 
That may be a little trickier!

SQL Server has a bunch of different "user ids" defined.

If you look in BOL (Books On-Line), you'll find at least:

CURRENT_USER
USER
SESSION_USER
SYSTEM_USER

While I once did some work on figuring out which is which, that was many
months ago (and, I think, several versions of SQL Server ago as well), and
unfortunately I don't remember which is which.

Try creating a pass-through query that returns whichever of those fields you
care about.
 

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

Similar Threads


Back
Top