Simpler still -- thanks everyone!

Tobi

-----Original Message-----
From: AccessDevelopers@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Richard
Sent: Wednesday, January 25, 2006 12:14 PM
To: AccessDevelopers@yahoogroups.com
Subject: [AccessDevelopers] Re: Finding paths to special folders.


Two?  I count three - you forgot Environmental Variables:

Check this code in Access:

for the Username:

MsgBox (Environ("username"))

and for the computer name:

MsgBox (Environ("computername"))

put those consecutive in the Load sub of a form and you should get 
two dialog boxes - the first showing the user ID currently logged in, 
the second showing the name of the CPU on the network.

HTH!

Alienwebmaster


--- In AccessDevelopers@yahoogroups.com, "Duane Hennessy" 
<[EMAIL PROTECTED]> wrote:
...
> You can grab the user name on of two ways:
> Via API:
> Private Declare Function GetUserName Lib "advapi32.dll" _
>     Alias "GetUserNameA" (ByVal Buffer As String, Size As Long) As
Long
> 
> Public Function Get USER_NAME() As String
>     'Author:           Duane Hennessy
>     'Date:             7.4.2003
>     'Description:      Returns the user name
>     'Requirements:     GetUserName
>     On Error Resume Next
>     Dim strUserName As String
>     Const lngcLength As Long = 255
>     Dim lngResult As Long
> 
>     strUserName = String(255, 0)
>     lngResult = GetUserName(strUserName, lngcLength)
>     USER_NAME = left$(strUserName, InStr(1, strUserName, Chr(0)) -
1)
> End Function







Please zip all files prior to uploading to Files section. 
Yahoo! Groups Links



 






Please zip all files prior to uploading to Files section. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AccessDevelopers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to