First of all make sure that your sub form is NOT linked to the main form on either the Child or Master (This is done the DATA section of the subform displayed on your master form).
Next : Using a subform name of 'mySfrm'
Main form control = txtUserName
sub form control name = txtsfUserName
In your main forms ON CURRENT event
put the following code
Me.txtUserName = me.mySfrm.form.txtsfUserName
This will pick up the value contained in control 'txtsfUsername' from the sub form and assign it to control txtUserName on the main form.
You may need to do a me.refresh to complete this operation.
An alternative to this is to use the currentuser function, use the oncuurent event with
me.txtUserName = currentuser()
this will work if you allways want to use the currently logged on user name, it has the benefit of not requireing a sub form and does not carry the system overhead of using a sub form.
The 3rd alternative, and the on I prefer to use due to its flexibility, is to use a opened, non-visible form. This form can be opened a start up and any values you want to put in it, then made invisible. After this you can reference any values on the visible form any time you want to. This is very useful for holding any system preferences, dates or other paramters. using code you can simple make the form visible at any time you want to alter any of the parameters.
Hope this helps