Difference between revisions of "Microsoft Access modWsh"
Jump to navigation
Jump to search
(Created page with '=== getUserName === <syntaxhighlight lang="vb"> Function getUserName() As String Dim strResult As String Dim wshNet As WshNetwork Set wshNet = New WshNetwor...') |
(No difference)
|
Revision as of 13:43, 1 July 2010
getUserName
Function getUserName() As String
Dim strResult As String
Dim wshNet As WshNetwork
Set wshNet = New WshNetwork
strResult = wshNet.UserName
getUserName = strResult
End Function
getComputerName
Function getComputerName() As String
Dim strResult As String
Dim wshNet As WshNetwork
Set wshNet = New WshNetwork
strResult = wshNet.ComputerName
getComputerName = strResult
End Function
getUserSuffix
Public Function getUserSuffix() As String
Dim strResult As String
strResult = getUserName
strResult = Replace(strResult, ".", "")
strResult = Replace(strResult, ",", "")
strResult = Replace(strResult, "-", "")
strResult = Replace(strResult, " ", "")
strResult = "_" & strResult
getUserSuffix = strResult
End Function
getUserTempTable
Public Function getUserTempTable(strSource As String) As String
Dim strResult As String
Const strTablePrefix = "_tbl"
strResult = strTablePrefix & Mid(strSource, 4) & getUserSuffix
getUserTempTable = strResult
End Function