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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User Name

Status
Not open for further replies.

BRANDON99

Technical User
Aug 29, 2003
52
FR
Hi

I would like the Windows user log on name to be recorded when the user add records to a table, is this possible?

Thanks

Brandon
 
If you're adding records to a table via a form, then in the BeforeUpdate event of the form, do something like this (where txtModifiedBy is a text control on the form whose control source is the field in your table)

If (Me.NewRecord) Then txtModifiedBy = environ("username")
 
I,ve tried this, but it doesn't seem to work. I want to be able to get the Windows user name to automatically be entered when data is added. Can this be done? and if so how?

Thanks

Brandon
 
I have just done
Me!name = Environ("UserName")
and it works perfectly but it was done in the On Current event. With the record locked when date inputted

Hope this helps
Hymn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top