kan jeg gemme værdien fra en function i et felt på en formular ?
Option Explicit\' Access the GetUserNameA function in advapi32.dll and
\' call the function GetUserName.
Declare Function GetUserName Lib \"advapi32.dll\" Alias \"GetUserNameA\" _
(ByVal lpBuffer As String, nSize As Long) As Long
\' Main routine to Dimension variables, retrieve user name
\' and display answer.
Function Get_User_Name()
\' Dimension variables
Dim lpBuff As String * 25
Dim ret As Long, username As String
\' Get the user name minus any trailing spaces found in the name.
ret = GetUserName(lpBuff, 25)
username = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1)
\"her vil jeg gerne overføre værdien af #username#
til formularen #Hovedmenu#
End Function
