Capture Log On

  • Thread starter Thread starter Neil Greenough
  • Start date Start date
N

Neil Greenough

I have a switchboard. In my switchboard, I would like to display the users
log-on ID for Windows.

So, I want a little text bit that says "You are logged on as XYZ"

Any idea how I would go about this? I know I need to capture the log on ID
from the system somehow, but any ideas? Also, I'm a little dim as to this
and so a step-by-step guide, along the lines of "Create an unbound field and
add the following VB code behind it....." will suffice :)

Thanks once again :)
 
I have used this code and pasted it into a new module. How do I now get my
form to get the data from this module. On my form, I want something saying
"Please ensure you are ..........(User ID from module)"

How do i link the info from the module to my form?
 
Lynn,

Can you just tell me how to call the function? So, for example, my module is
called NEW1. How do I call it in the unbound text box?

Thanks
 
in message:
Can you just tell me how to call the function? So, for example, my module is
called NEW1. How do I call it in the unbound text box?

On the Default Value (on Properties list) just enter this:

fOSUserName()

When the form opens it will show the current logged on Windows
user name. I would also set the text box to be locked and not enabled.
 
I am getting the following in the text box, #Name?

Any idea why? I have done as you said Jeff, and my module is called
fOSUserName()
 
Cheers both Lynn and Jeff.

I am getting #NAME in my unbound text box. Is this simply because I am
working at home and so, I am not working on a networked computer?

Many thanks again
 
"Neil Greenough" wrote in message:
I am getting the following in the text box, #Name?

Any idea why? I have done as you said Jeff, and my module is called
fOSUserName()

Any module name cannot be the same as any procedure or function
name because Access goes, "Dude, what's up? I'm confused"

Change the module name itself to modUserName or basUserName
to eliminate confusion.

Here are some links on naming conventions which you may find helpful:

http://www.ltcomputerdesigns.com/JCReferences.html#NamingConventions

Compile the code and then test. All should be good.
 
You don't need to be on a networked computer for that API call to work.

I think Jeff nailed it: if you named the module the same as the function, it
isn't going to work.
 
I am getting #NAME in my unbound text box. Is this simply because I am
working at home and so, I am not working on a networked computer?

Set the Control Source property of the textbox to

=fOSUserName()

The = sign is necessary.

John W. Vinson[MVP]
 
FANTASTIC!

All works now! Changed name of module as recommended. Wasn't sure about this
as was wondering how it would link the two different names together :)
 

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

Securities 1
Amazon Login Location Different 4
Switchboard Password 2
Access Switchboard error message 1
Switchboard in Access 2007 1
Form References 2
switchboard problem 4
Switchboard Page - User Level Security 1

Back
Top