Get User Login Name

  • Thread starter Paco via AccessMonster.com
  • Start date
P

Paco via AccessMonster.com

I usee the following link and placed it in a module named “FOSUserName”.
http://www.mvps.org/access/api/api0008.htm

Then, I created a field in my table named “Userid”. I placed this text box
on my form and in the default value property I entered: =FOSUserName()

But when I open the form, the text box is always blank. It should show my
name as the user.

Can anyone tell me how to get the User name in the text box on my form??

Thanks,
Paco
 
G

Guest

Hi,

I had set up a workgroup with user names and permissions. In the unbound
text box where the current user name was to appear, I put in the function
=CurrentUser() for the rowsource property and then disabled the textbox so it
was not open for edit. This was a simple approach and worked for me. I don't
know if it will be of any help.
 
P

Paco via AccessMonster.com

Hi, This will not work for me. I'm trying to get the User name from the
Network login. The link to the routine below calls and gets the user name
from the network, but I don't know how to get it to appear on my form.

Please help.......
Paco

MS said:
Hi,

I had set up a workgroup with user names and permissions. In the unbound
text box where the current user name was to appear, I put in the function
=CurrentUser() for the rowsource property and then disabled the textbox so it
was not open for edit. This was a simple approach and worked for me. I don't
know if it will be of any help.
I usee the following link and placed it in a module named “FOSUserName”.
http://www.mvps.org/access/api/api0008.htm
[quoted text clipped - 9 lines]
Thanks,
Paco
 
D

Douglas J. Steele

Rename your module to something like mdlUserName. Modules cannot have the
same name as functions or subs.
 
P

Paco via AccessMonster.com

Hi Douglas,
I renamed the module as suggested, but when I open the form, the text box is
blank. Should I maybe code something in the "on form open" event???

Thanks,
Paco
Rename your module to something like mdlUserName. Modules cannot have the
same name as functions or subs.
I usee the following link and placed it in a module named “FOSUserName”.
http://www.mvps.org/access/api/api0008.htm
[quoted text clipped - 10 lines]
Thanks,
Paco
 
G

Guest

I don't believe user functions work in table designer. You need to load in
the form 'open event' code as you suggested.
I use that function all the time with no problem.
Dorian

Paco via AccessMonster.com said:
Hi Douglas,
I renamed the module as suggested, but when I open the form, the text box is
blank. Should I maybe code something in the "on form open" event???

Thanks,
Paco
Rename your module to something like mdlUserName. Modules cannot have the
same name as functions or subs.
I usee the following link and placed it in a module named “FOSUserNameâ€.
http://www.mvps.org/access/api/api0008.htm
[quoted text clipped - 10 lines]
Thanks,
Paco
 
P

Paco via AccessMonster.com

Hi,
What should I code in the Form Open Event to place the FOSUserName in my text
box names Userid?
I don't believe user functions work in table designer. You need to load in
the form 'open event' code as you suggested.
I use that function all the time with no problem.
Dorian
Hi Douglas,
I renamed the module as suggested, but when I open the form, the text box is
[quoted text clipped - 11 lines]
 
D

Douglas J. Steele

Me.Userid = fOSUserName()

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Paco via AccessMonster.com said:
Hi,
What should I code in the Form Open Event to place the FOSUserName in my
text
box names Userid?
I don't believe user functions work in table designer. You need to load in
the form 'open event' code as you suggested.
I use that function all the time with no problem.
Dorian
Hi Douglas,
I renamed the module as suggested, but when I open the form, the text
box is
[quoted text clipped - 11 lines]
Thanks,
Paco
 
P

Paco via AccessMonster.com

Hi,
I made the change below, and the userid is present. But when I click on the
navigation button to see the next record on the same form, the userid
disappears.

I tried Me.userid=fOSUserName() afterupdate, onchange of dataset, onform
open ..... but it still remains blank. How can I get the Userid to remain in
the text box even when the user is going to the next record on the same form??


Thanks,
Paco
Me.Userid = fOSUserName()
Hi,
What should I code in the Form Open Event to place the FOSUserName in my
[quoted text clipped - 12 lines]
 
D

Douglas J. Steele

Use the Current event.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Paco via AccessMonster.com said:
Hi,
I made the change below, and the userid is present. But when I click on
the
navigation button to see the next record on the same form, the userid
disappears.

I tried Me.userid=fOSUserName() afterupdate, onchange of dataset, onform
open ..... but it still remains blank. How can I get the Userid to remain
in
the text box even when the user is going to the next record on the same
form??


Thanks,
Paco
Me.Userid = fOSUserName()
Hi,
What should I code in the Form Open Event to place the FOSUserName in my
[quoted text clipped - 12 lines]
Thanks,
Paco
 
P

Paco via AccessMonster.com

Thank You Douglas!! I had too many other events open. Once I closed them
and used only the Current event it worked.

Thanks Again....
Paco
Use the Current event.
Hi,
I made the change below, and the userid is present. But when I click on
[quoted text clipped - 18 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top