Entering UserName on Form

  • Thread starter Thread starter Judy Freed
  • Start date Start date
J

Judy Freed

I am trying to come up with a method for automatically entering the user's
name or windows 2000/novell login on a field in a form.



I have copied the Get Login name code from www.mvps.org and copied it into a
new module. I then saved the module, naming it UserName



My problem is that I don't know what to do next. I have gone into the field
's properties and for the On Click, I have used the Expression Builder to
enter the function,so the field looks like this:



= fOSUserName ()



but the field remains blank. (I would really rather have this be invisible
to the user, like a Before Update type of thing) but will settle for On
Click if I can make it work.



Can anybody help me? I've not had any experience with modules, so I probably
have this all messed up - any and all guidance appreciated.
 
Judy said:
I am trying to come up with a method for automatically entering the user's
name or windows 2000/novell login on a field in a form.

I have copied the Get Login name code from www.mvps.org and copied it into a
new module. I then saved the module, naming it UserName

My problem is that I don't know what to do next. I have gone into the field
's properties and for the On Click, I have used the Expression Builder to
enter the function,so the field looks like this:

= fOSUserName ()

but the field remains blank. (I would really rather have this be invisible
to the user, like a Before Update type of thing) but will settle for On
Click if I can make it work.

Can anybody help me? I've not had any experience with modules, so I probably
have this all messed up - any and all guidance appreciated.

You could put this in the OnCurrent event or the BeforeUpdate event of the form
if the field is bound to a record and you wanted each record to contain the user
name.
If the field is unbound, then you can put it in the FormOpen event and use it
however
its needed. No matter what event you put it in, you can still hide the control
from the
user.

Me!txtUserName = fOSUserName ()
or

Dim txtUserName as string
txtUserName = fOSUserName ()

HTH,
Ron
 
Back
Top