473,509 Members | 2,857 Online
Bytes | Software Development & Data Engineering Community
+ 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 35899
"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
1492
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
2577
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
1485
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
1774
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
1378
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
2327
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
967
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
11676
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
7136
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
7344
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7412
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
7069
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
7505
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...
0
4730
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3203
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
775
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.