Get User Name

  • Thread starter Thread starter MP
  • Start date Start date
M

MP

I need to capture the Windows UserName in a field on a
form to record who entered the record.

Will =CurrentUser() on the Default Value line of the Form
Field do the trick? Could it be that easy? Please help
 
Thank You for the site reference!

I have created the module as the site specifies.
However, I have no idea how to get this info, the User's
Name, into a field on a form. I'll need to capture this
info in different fields, each on a separate form.

How do I now get this info, the User's Name, into a field?
 
for a control on a form, open the properties window, select the "After Update" event and put code on that event

Private Sub ControlName_AfterUpdate(

call (name of function)

End Su

You can also call the code on the BeforeUpdate event of the form rather than after a control is updated
HTH
 
In your Form, set the Table Field "OSUserName" as the ControlSource for the
relevant TextBox and set the Default Value Property of the TextBox to:

= fOSUserName()

(including the equal sign).
 
Back
Top