PC Review


Reply
Thread Tools Rate Thread

Re: capture NT User name

 
 
Douglas J. Steele
Guest
Posts: n/a
 
      8th Sep 2004
Save the module you copied the code into (make sure you don't name the
module fOSUserName).

Now, call the function fOSUserName wherever you want to know the user name.

For example, you can set the Control Source for a text box to
=fOSUserName(), and the text box will then show the user name. (make sure
you include the = sign)



--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"JMorrell" <(E-Mail Removed)> wrote in message
news:7E1402ED-DBD1-4493-8CBB-(E-Mail Removed)...
> I've read posts about capturing the NT logon ID and looked at the script
> posted here -> http://www.mvps.org/access/api/api0008.htm
>
> I've a really simple question now. Now that the module is created, now
> what? How do I run it, use it, read the fOSUserName? Sorry, but this is

new
> territory for me.
>
> tia,
> --
> JMorrell



 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      9th Sep 2004
It's a function. The only way to get a value from a function is to call the
function.

You could assign its value to a global variable and then refer to the global
variable. However, I'd recommend calling the function each time, to ensure
that nothing's happened to the value of the variable. There's very little
overhead involved in the call.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"JMorrell" <(E-Mail Removed)> wrote in message
news:2437CA4D-1951-4C34-9E54-(E-Mail Removed)...
> I understand now. Thanks. I can think of lots of ways that this can be

of
> use to me. Isn't there a way to make the fOSUserName known globally, as

in
> "until user logs off?" I don't think I would want to run (or maybe I

would)
> every time I need the UserName. I made it Public, instead of Private, but
> the value of fOSUser was "<Out of context>" in subsequent forms, reports,
> etc.
>
> Let me explain what I want to be able to do. I want a user to be able to
> look at their own records in an HR type database. I also want any

supervisor
> to be able to look at any of their employees records. By capturing the
> logged on user name, I can reference all of their "downstream" employees.
>
> I'm open to any suggestions as to how best go about this.
>
> tiaa,
> JMorrell
>
> "Douglas J. Steele" wrote:
>
> > Save the module you copied the code into (make sure you don't name the
> > module fOSUserName).
> >
> > Now, call the function fOSUserName wherever you want to know the user

name.
> >
> > For example, you can set the Control Source for a text box to
> > =fOSUserName(), and the text box will then show the user name. (make

sure
> > you include the = sign)
> >
> >
> >
> > --
> > Doug Steele, Microsoft Access MVP
> > http://I.Am/DougSteele
> > (no e-mails, please!)
> >
> >
> >
> > "JMorrell" <(E-Mail Removed)> wrote in message
> > news:7E1402ED-DBD1-4493-8CBB-(E-Mail Removed)...
> > > I've read posts about capturing the NT logon ID and looked at the

script
> > > posted here -> http://www.mvps.org/access/api/api0008.htm
> > >
> > > I've a really simple question now. Now that the module is created,

now
> > > what? How do I run it, use it, read the fOSUserName? Sorry, but this

is
> > new
> > > territory for me.
> > >
> > > tia,
> > > --
> > > JMorrell

> >
> >
> >



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Capture user ID... Doolee Microsoft Excel Misc 2 24th Mar 2008 08:20 PM
Capture user name =?Utf-8?B?S2FtcmFu?= Microsoft Excel Programming 3 22nd May 2007 04:14 PM
How do I capture the user name? =?Utf-8?B?Sm9obm55IEJyaWdodA==?= Microsoft Access VBA Modules 1 18th May 2005 10:14 PM
Can't capture anything-1st time mm user Stephen Windows XP Video 1 3rd Nov 2003 03:06 PM
How to capture the User authentication user name using Access 2000 Joel Microsoft Access 3 20th Sep 2003 01:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:50 PM.