Set username as default value in Access table

前端 未结 1 1864
半阙折子戏
半阙折子戏 2021-01-25 04:50

I have an access table with a column username. I have multiple users that will use the database at different times and they will add rows to the table. But everytim

相关标签:
1条回答
  • 2021-01-25 05:14

    Create a public function as described here:

    Public Function GetUserName() As String
        ' GetUserName = Environ("USERNAME")
        ' Environ("USERNAME") is easily spoofed, see comment by HansUp
        GetUserName = CreateObject("WScript.Network").UserName
    End Function
    

    and use =GetUserName() as default value for the control.

    0 讨论(0)
提交回复
热议问题