Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Access

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-09-2008, 02:21 AM
slickdock@yahoo.com
 
Posts: n/a
Network user name

How can I default a field in Access to equal the name the user is
logged in to the Windows server network as?
Reply With Quote
  #2 (permalink)  
Old 09-09-2008, 02:36 AM
Chris O'C via AccessMonster.com
 
Posts: n/a
Re: Network user name

You can find the code here:

http://www.mvps.org/access/api/api0008.htm

Put this function in the text box's default value property.

=fOSUserName()


Chris
Microsoft MVP


slickdock@yahoo.com wrote:
>How can I default a field in Access to equal the name the user is
>logged in to the Windows server network as?


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200809/1

Reply With Quote
  #3 (permalink)  
Old 09-09-2008, 02:38 AM
Arvin Meyer [MVP]
 
Posts: n/a
Re: Network user name

<slickdock@yahoo.com> wrote in message
news:830d3bb6-d592-443c-a3f5-b8facc686ac9@w1g2000prk.googlegroups.com...
> How can I default a field in Access to equal the name the user is
> logged in to the Windows server network as?


First get the network username:

http://www.mvps.org/access/api/api0008.htm

and paste it into a module. Then set the default value property of the
textbox to:

=fOSUsername()

which is the name of the function at the hyperlink above.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Reply With Quote
  #4 (permalink)  
Old 09-09-2008, 03:39 AM
=?Utf-8?B?Ym9ibGFyc29u?=
 
Posts: n/a
RE: Network user name

And make sure to name the module something OTHER than the function name
(fOSUsername).
--
Bob Larson

Free Tutorials and Samples at http://www.btabdevelopment.com

__________________________________


"slickdock@yahoo.com" wrote:

> How can I default a field in Access to equal the name the user is
> logged in to the Windows server network as?
>

Reply With Quote
  #5 (permalink)  
Old 09-09-2008, 07:30 PM
slickdock@yahoo.com
 
Posts: n/a
Re: Network user name

On Sep 8, 7:39*pm, boblarson <boblar...@discussions.microsoft.com>
wrote:
> And make sure to name the module something OTHER than the function name
> (fOSUsername).
> --
> Bob Larson
>
> Free Tutorials and Samples athttp://www.btabdevelopment.com
>
> __________________________________
>
>
>
> "slickd...@yahoo.com" wrote:
> > How can I default a field in Access to equal the name the user is
> > logged in to the Windows server network as?- Hide quoted text -

>
> - Show quoted text -


Beautiful! Thank you everyone! It works perfectly for the
[RecordCreatedBy] field.
How can I make it work for the [RecordRevisedBy] field? I assume I
have to assign a macro to the Before Update property of the form that
Runs Code =fOSUsername() and places that value in the
[RecordRevisedBy] field, but my lame attempts have failed due to my
limited VBA experience.
Reply With Quote
  #6 (permalink)  
Old 09-09-2008, 08:42 PM
=?Utf-8?B?Ym9ibGFyc29u?=
 
Posts: n/a
Re: Network user name

It would just be:

Me!RecordRevisedBy = fOSUsername()
--
Bob Larson

Free Tutorials and Samples at http://www.btabdevelopment.com

__________________________________


"slickdock@yahoo.com" wrote:

> On Sep 8, 7:39 pm, boblarson <boblar...@discussions.microsoft.com>
> wrote:
> > And make sure to name the module something OTHER than the function name
> > (fOSUsername).
> > --
> > Bob Larson
> >
> > Free Tutorials and Samples athttp://www.btabdevelopment.com
> >
> > __________________________________
> >
> >
> >
> > "slickd...@yahoo.com" wrote:
> > > How can I default a field in Access to equal the name the user is
> > > logged in to the Windows server network as?- Hide quoted text -

> >
> > - Show quoted text -

>
> Beautiful! Thank you everyone! It works perfectly for the
> [RecordCreatedBy] field.
> How can I make it work for the [RecordRevisedBy] field? I assume I
> have to assign a macro to the Before Update property of the form that
> Runs Code =fOSUsername() and places that value in the
> [RecordRevisedBy] field, but my lame attempts have failed due to my
> limited VBA experience.
>

Reply With Quote
  #7 (permalink)  
Old 09-11-2008, 08:26 PM
=?Utf-8?B?c3Q4ZW1wbG95ZWU=?=
 
Posts: n/a
RE: Network user name

I followed you guys' instructions:

I created a module,
pasted the code in a new module,
named the new module "GET USERNAME",
created anew form,
inserted an unbound text box,
and set the default value property to "=fOSUserName()"

....but all I get is "#Name?" in the text box. SO there's something I am not
doing correctly...

I am not a programmer...Please advise me. THANX.

-St8employee


"boblarson" wrote:

> And make sure to name the module something OTHER than the function name
> (fOSUsername).
> --
> Bob Larson
>
> Free Tutorials and Samples at http://www.btabdevelopment.com
>
> __________________________________
>
>
> "slickdock@yahoo.com" wrote:
>
> > How can I default a field in Access to equal the name the user is
> > logged in to the Windows server network as?
> >

Reply With Quote
  #8 (permalink)  
Old 09-12-2008, 01:56 PM
Arvin Meyer [MVP]
 
Posts: n/a
Re: Network user name

So I followed your instructions exactly and it worked as expected. I can see
a possible mistake that you may have made:

You didn't copy all of the code, specifically the declare:

Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"st8employee" <st8employee@discussions.microsoft.com> wrote in message
news:B737E096-5DCF-4F75-90F1-8BBC9A76A74A@microsoft.com...
>I followed you guys' instructions:
>
> I created a module,
> pasted the code in a new module,
> named the new module "GET USERNAME",
> created anew form,
> inserted an unbound text box,
> and set the default value property to "=fOSUserName()"
>
> ...but all I get is "#Name?" in the text box. SO there's something I am
> not
> doing correctly...
>
> I am not a programmer...Please advise me. THANX.
>
> -St8employee
>
>
> "boblarson" wrote:
>
>> And make sure to name the module something OTHER than the function name
>> (fOSUsername).
>> --
>> Bob Larson
>>
>> Free Tutorials and Samples at http://www.btabdevelopment.com
>>
>> __________________________________
>>
>>
>> "slickdock@yahoo.com" wrote:
>>
>> > How can I default a field in Access to equal the name the user is
>> > logged in to the Windows server network as?
>> >



Reply With Quote
  #9 (permalink)  
Old 09-12-2008, 02:09 PM
=?Utf-8?B?c3Q4ZW1wbG95ZWU=?=
 
Posts: n/a
Re: Network user name

I copied everything from where it says ***code start*** to where it says
***code end*** ...asteriks and all...

what am I doing wrong...? (I am really a novice with programming...have
literally NO experience outside of writing complex command strings in Access
query criteria and building snazzy macros...)

"Arvin Meyer [MVP]" wrote:

> So I followed your instructions exactly and it worked as expected. I can see
> a possible mistake that you may have made:
>
> You didn't copy all of the code, specifically the declare:
>
> Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
> "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
> --
> Arvin Meyer, MCP, MVP
> http://www.datastrat.com
> http://www.mvps.org/access
> http://www.accessmvp.com
>
>
> "st8employee" <st8employee@discussions.microsoft.com> wrote in message
> news:B737E096-5DCF-4F75-90F1-8BBC9A76A74A@microsoft.com...
> >I followed you guys' instructions:
> >
> > I created a module,
> > pasted the code in a new module,
> > named the new module "GET USERNAME",
> > created anew form,
> > inserted an unbound text box,
> > and set the default value property to "=fOSUserName()"
> >
> > ...but all I get is "#Name?" in the text box. SO there's something I am
> > not
> > doing correctly...
> >
> > I am not a programmer...Please advise me. THANX.
> >
> > -St8employee
> >
> >
> > "boblarson" wrote:
> >
> >> And make sure to name the module something OTHER than the function name
> >> (fOSUsername).
> >> --
> >> Bob Larson
> >>
> >> Free Tutorials and Samples at http://www.btabdevelopment.com
> >>
> >> __________________________________
> >>
> >>
> >> "slickdock@yahoo.com" wrote:
> >>
> >> > How can I default a field in Access to equal the name the user is
> >> > logged in to the Windows server network as?
> >> >

>
>
>

Reply With Quote
  #10 (permalink)  
Old 09-14-2008, 04:37 PM
Arvin Meyer [MVP]
 
Posts: n/a
Re: Network user name

Did you use:

"=fOSUserName()"

or:

=fOSUserName()
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"st8employee" <st8employee@discussions.microsoft.com> wrote in message
news:9C64BB12-E3D6-4725-B128-80BE88F29208@microsoft.com...
>I copied everything from where it says ***code start*** to where it says
> ***code end*** ...asteriks and all...
>
> what am I doing wrong...? (I am really a novice with programming...have
> literally NO experience outside of writing complex command strings in
> Access
> query criteria and building snazzy macros...)
>
> "Arvin Meyer [MVP]" wrote:
>
>> So I followed your instructions exactly and it worked as expected. I can
>> see
>> a possible mistake that you may have made:
>>
>> You didn't copy all of the code, specifically the declare:
>>
>> Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
>> "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
>> --
>> Arvin Meyer, MCP, MVP
>> http://www.datastrat.com
>> http://www.mvps.org/access
>> http://www.accessmvp.com
>>
>>
>> "st8employee" <st8employee@discussions.microsoft.com> wrote in message
>> news:B737E096-5DCF-4F75-90F1-8BBC9A76A74A@microsoft.com...
>> >I followed you guys' instructions:
>> >
>> > I created a module,
>> > pasted the code in a new module,
>> > named the new module "GET USERNAME",
>> > created anew form,
>> > inserted an unbound text box,
>> > and set the default value property to "=fOSUserName()"
>> >
>> > ...but all I get is "#Name?" in the text box. SO there's something I am
>> > not
>> > doing correctly...
>> >
>> > I am not a programmer...Please advise me. THANX.
>> >
>> > -St8employee
>> >
>> >
>> > "boblarson" wrote:
>> >
>> >> And make sure to name the module something OTHER than the function
>> >> name
>> >> (fOSUsername).
>> >> --
>> >> Bob Larson
>> >>
>> >> Free Tutorials and Samples at http://www.btabdevelopment.com
>> >>
>> >> __________________________________
>> >>
>> >>
>> >> "slickdock@yahoo.com" wrote:
>> >>
>> >> > How can I default a field in Access to equal the name the user is
>> >> > logged in to the Windows server network as?
>> >> >

>>
>>
>>



Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Access


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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



All times are GMT. The time now is 04:37 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Myspace Proxy | Manual directory submissions | Mortgages | Bad Credit Loan | Credit Report



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114