473,487 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Get windows logon username into a form field

Hi How do I get the windows login name into a field on a form? I found
this code from searching but I can't figure out how to use it...
http://www.mvps.org/access/api/api0008.htm

Thanks,
Ciarán
Sep 30 '08 #1
9 35895
"Cron" <cr*******@hotmail.comwrote in message
news:f2**********************************@y21g2000 hsf.googlegroups.com...
Hi How do I get the windows login name into a field on a form? I found
this code from searching but I can't figure out how to use it...
http://www.mvps.org/access/api/api0008.htm

Thanks,
Ciarán

Assuming you've saved the code in a module, put the name of the function in
the "Default Value" property of the control you want to display it:

=fOSUserName

Keith.
www.keithwilby.com

Sep 30 '08 #2
Cron wrote:
Hi How do I get the windows login name into a field on a form? I found
this code from searching but I can't figure out how to use it...
http://www.mvps.org/access/api/api0008.htm

Thanks,
Ciarán
Dim strLoginName As String
strLoginName = fOSUserName()

Texas
http://www.youtube.com/watch?v=dWlUSR6wSzA
Sep 30 '08 #3
On Sep 30, 2:45*pm, "Keith Wilby" <h...@there.comwrote:
"Cron" <cronok...@hotmail.comwrote in message

news:f2**********************************@y21g2000 hsf.googlegroups.com...
Hi How do I get the windows login name into a field on a form? I found
this code from searching but I can't figure out how to use it...http://www.mvps.org/access/api/api0008.htm

Thanks,
Ciarán

Assuming you've saved the code in a module, put the name of the function in
the "Default Value" property of the control you want to display it:

=fOSUserName

Keith.www.keithwilby.com
Thanks for the reply Keith, I've added the code to a new module and
made a new form containing one field with default value =fOSUserName.
The field reads "#Name?" when the form is run. Do I need to link the
module to the form somehow? Sorry I've only done very simple stuff
with VBA.
Cheers
Ciarán
Sep 30 '08 #4

"Cron" <cr*******@hotmail.comwrote in message
news:b5**********************************@y21g2000 hsf.googlegroups.com...
On Sep 30, 2:45 pm, "Keith Wilby" <h...@there.comwrote:
"Cron" <cronok...@hotmail.comwrote in message

news:f2**********************************@y21g2000 hsf.googlegroups.com...
Hi How do I get the windows login name into a field on a form? I found
this code from searching but I can't figure out how to use
it...http://www.mvps.org/access/api/api0008.htm

Thanks,
Ciarán

Assuming you've saved the code in a module, put the name of the function
in
the "Default Value" property of the control you want to display it:

=fOSUserName

Keith.www.keithwilby.com
Thanks for the reply Keith, I've added the code to a new module and
made a new form containing one field with default value =fOSUserName.
The field reads "#Name?" when the form is run. Do I need to link the
module to the form somehow? Sorry I've only done very simple stuff
with VBA.
Cheers
Ciarán

You might try setting the Default Value to =fosUserName().
Fred Zuckerman
Sep 30 '08 #5
Cron wrote:
On Sep 30, 2:45 pm, "Keith Wilby" <h...@there.comwrote:
>>"Cron" <cronok...@hotmail.comwrote in message

news:f2**********************************@y21g20 00hsf.googlegroups.com...
Hi How do I get the windows login name into a field on a form? I found
this code from searching but I can't figure out how to use it...http://www.mvps.org/access/api/api0008.htm

Thanks,
Ciarán

Assuming you've saved the code in a module, put the name of the function in
the "Default Value" property of the control you want to display it:

=fOSUserName

Keith.www.keithwilby.com
I created a new form, put in a text box and entered
=fOSUserName
and attempted to run the form. Got a #Name. I reopened the form in
design mode And the default value looked like
=[fOSUserName]

I changed it to
=fOSUserName()
and it worked.

>
Thanks for the reply Keith, I've added the code to a new module and
made a new form containing one field with default value =fOSUserName.
The field reads "#Name?" when the form is run. Do I need to link the
module to the form somehow? Sorry I've only done very simple stuff
with VBA.
Cheers
Ciarán
Sep 30 '08 #6
On Sep 30, 8:26*pm, Salad <o...@vinegar.comwrote:
Cron wrote:
On Sep 30, 2:45 pm, "Keith Wilby" <h...@there.comwrote:
I changed it to
* * * * =fOSUserName()
and it worked.

Brilliant! Perfect! Thanks!
Oct 1 '08 #7
"Cron" <cr*******@hotmail.comwrote in message
news:2f**********************************@u26g2000 hsd.googlegroups.com...
On Sep 30, 8:26 pm, Salad <o...@vinegar.comwrote:
Cron wrote:
On Sep 30, 2:45 pm, "Keith Wilby" <h...@there.comwrote:
I changed it to
=fOSUserName()
and it worked.
Brilliant! Perfect! Thanks!
Missed the brackets, sorry folks.

Oct 1 '08 #8
>Hi How do I get the windows login name into a field on a form? I found
>this code from searching but I can't figure out how to use it...
http://www.mvps.org/access/api/api0008.htm
wonder why a marvellous site like http://www.mvps.org show a solution for
something, already accessible through:
environ("username")
--
Benny Andersen
Oct 1 '08 #9
"Benny Andersen" <a.*********@gmail.comwrote in message
news:88****************************@40tude.net...
>>Hi How do I get the windows login name into a field on a form? I found
this code from searching but I can't figure out how to use it...
http://www.mvps.org/access/api/api0008.htm

wonder why a marvellous site like http://www.mvps.org show a solution for
something, already accessible through:
environ("username")
Because that variable can apparently be modified by a smart user.

Oct 1 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1491
by: Bharat Suneja | last post by:
Hi All, I'm running into issues with passing the distinguishedName of a user as a hidden form field in a form from one page to the result page. Page 1: User enters user name in a form field ...
3
2570
by: Bob | last post by:
I'm a total newbie at Javascript, but a programmer for over 20 years... so, my plans may be bigger than they are possible. I'm trying to set with Javascript the value of a form field... easy...
2
1484
by: Evan Basalik | last post by:
I have an ASP.NET application which uses forms authentication. For some reason, after someone logs in, they get a Windows logon dialog whenever they try to access any ASPX files in the...
2
1772
by: Joergen Bech | last post by:
(trying again with a shorter message - hope anyone has any ideas)... Trying to get my aspx application to run on a remote server beyond my control (except ftp access). First time I access an...
0
1374
by: genzy | last post by:
I'm facing the below problem. With <deny users="?" />, the Windows Login ID is able to be obtained to fill up the Windows IDSID text field automatically, but reading the file info is failed. ...
5
2326
by: drummerpunk10 | last post by:
Sorry if this is off topic, I haven't really used this forum a lot so I don't know where to put it. Anyways I have a game application that runs off a list games and users on a file, that I built in...
0
965
by: ruzeezur | last post by:
I want to replace the windows Logon with my own on my PDA using C#(.NET). How do I do that? The program should be simple but I don't know how to deactivate windows logon. Thanks
0
1580
by: ruzeezur | last post by:
I want to program my own logon on my PDA using C#. The program should be simple, but can someone please help me how to bypass/change/remove windows logon with my own? Thanks
5
11674
by: Aamir47p | last post by:
Please help meI want to get windows logon and logoff time and store it in a text file by using vb.net. windows logon date/time and windows logout date/time and store it in text file "c:/a.txt How...
0
7108
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6967
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7181
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6847
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7352
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4875
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
618
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.