Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UserName query

Status
Not open for further replies.

laspates

Technical User
Jan 8, 2007
2
US
I have created an Access database which accepts submitted information from two InfoPath forms. I'm trying to create a field in my database which will automatically capture the user name upon submission. I've suceessfully done it with the date, using the =Now() function, but I can't figure out how to capture the user name.

Suggestions?

l.a.spates
 
The windows (not 9x) network login name: Environ("USERNAME")
The secured database logged user: Application.CurrentUser

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Would you be able to elaborate slightly? I'm a new, self-taught user. I'm doing plenty of reasearch, too....

Thanks,
l.a.spates
 
You can't set a default in a table/field definition of the user name. You would need to enter the default into a control on a form.

PH pointed out two different definitions for "User Name". You didn't specify which one you want to use. I actually prefer the API at over the ENVIRON() function.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top