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?
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.