Retrieve Login Name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I just tried to display the current Access users loginname with the
following script found on this forum:
http://www.mvps.org/access/api/api0008.htm

But I can't figure out how to get this to work. I just want to display the
current username in a TextBox as a Default Value.

Can anybody help me? I'm not a real pro in coding, but I can understand what
is meant and what to do..

Thanks in advance
 
Copy and paste the code into a standard module as the web page describes,
then enter the following as the Default Value property of the text box ...

=fOSUserName()
 
Copy everything from between the Code Start and Code End lines into a new
module, and save the module. Make sure you don't name the module fOSUserName
(modules cannot be named the same as routines that they contain) Also, make
sure you're not using a Class module.

Put =fOSUserName() as the DefaultValue property for the textbox in your
form. Include the equal sign and parentheses. Note that this will only work
in forms: you cannot use a user-defined function as a default value for a
field in a table.
 
Is this possible for users on Windows 98 OS?

Douglas J Steele said:
Copy everything from between the Code Start and Code End lines into a new
module, and save the module. Make sure you don't name the module fOSUserName
(modules cannot be named the same as routines that they contain) Also, make
sure you're not using a Class module.

Put =fOSUserName() as the DefaultValue property for the textbox in your
form. Include the equal sign and parentheses. Note that this will only work
in forms: you cannot use a user-defined function as a default value for a
field in a table.
 
Back
Top