D
DIDS
Hello,
I have a database where the user's enter their Windows ID into a text
box on a form. I would like to change it so that the field on the
form is automatically populated and the user's cannot change it. I
have a module with the below defined:
Public Declare Function GetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" _
(ByVal lpBuffer As String, _
nSize As Long) As Long
Public Function UserName() As String
Dim sName As String * 256
Dim cChars As Long
cChars = 256
If GetUserName(sName, cChars) Then
UserName = Left$(sName, cChars - 1)
End If
End Function
The text box currently has the Control Source set to OperatorRef#
which is in tblTempMeter. If I change the Control Source to
=UserName() it shows the Windows ID of the user but it does not put
that into the OperatorRef# field in tblTempMeter. How can I pass the
Windows ID from the text box to the OperatorRef# field in
tblTempMeter?
Thanks for any help you can provide,
DIDS
I have a database where the user's enter their Windows ID into a text
box on a form. I would like to change it so that the field on the
form is automatically populated and the user's cannot change it. I
have a module with the below defined:
Public Declare Function GetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" _
(ByVal lpBuffer As String, _
nSize As Long) As Long
Public Function UserName() As String
Dim sName As String * 256
Dim cChars As Long
cChars = 256
If GetUserName(sName, cChars) Then
UserName = Left$(sName, cChars - 1)
End If
End Function
The text box currently has the Control Source set to OperatorRef#
which is in tblTempMeter. If I change the Control Source to
=UserName() it shows the Windows ID of the user but it does not put
that into the OperatorRef# field in tblTempMeter. How can I pass the
Windows ID from the text box to the OperatorRef# field in
tblTempMeter?
Thanks for any help you can provide,
DIDS