Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
txtCreatedBy.Value = CurrentUser()
txtCreatedBy.Value = fOSUserName()
'-----------begin copying below-----------------
Option Explicit
'source: http://groups.google.com/groups?selm=387490BE.1CD2C4D3%40barneyboller.com
Public Declare Function WNetGetUser Lib "mpr.dll" _
Alias "WNetGetUserA" (ByVal lpName As String, _
ByVal lpUserName As String, lpnLength As Long) As Long
Const NoError = 0 'The Function call was successful
Public Function apiNetUserName() As String
' Buffer size for the return string.
Const lpnLength As Integer = 255
' Get return buffer space.
Dim status As Integer
' For getting user information.
Dim lpName, lpUserName As String
' Assign the buffer size constant to lpUserName.
lpUserName = Space$(lpnLength + 1)
' Get the log-on name of the person using product.
status = WNetGetUser(lpName, lpUserName, lpnLength)
' See whether error occurred.
If status = NoError Then
' This line removes the null character. Strings in C are null-
' terminated. Strings in Visual Basic are not null-terminated.
' The null character must be removed from the C strings to be used
' cleanly in Visual Basic.
lpUserName = Left$(lpUserName, InStr(lpUserName, Chr(0)) - 1)
Else
' An error occurred.
lpUserName = ""
End
End If
FindNetUserName = lpUserName
End Function
'-----------------stop here---------------
txtCreatedBy.Value = apiNetUserName()
txtComputerName.Value = fOSMachineName()
txtCreatedBy.Value = Environ("USERNAME")
C:\>SET USERNAME=BILLG
strSQL = strSQL & [USERID] = " & Chr(34) & UCase(CurrentUser()) & Chr(34)