Im trying to insert a user name into a table on opening a Welcome Form.
The error is within the DoCmd.runsql. and on opening the form it is asking for GUN?
Could anybody please advise?
Many thanks
The error is within the DoCmd.runsql. and on opening the form it is asking for GUN?
Could anybody please advise?
Code:
Me.GetUserNametxt = Environ("username")
Dim GUN As String
GUN = Me.GetUserNametxt
DoCmd.RunSQL "INSERT INTO tblUserName (UserName) VALUES (GUN);"
Many thanks