Then add to the Fields on the Form a calling code to the function.Add the fields to the Form is they are not already there.you will need to have the fields desired contained in the Table the Form is based.The code block should be entered into a standard module.Just back from vacation!!! Now I can relax:) While using MS Access 2003 we were usedĮnviron('UserName') to get the Login UserID but this is not working inĬan you tell me how to get this into A2010? I can't seem to get a control to read it. 'Kannancsit' schrieb im Newsbeitrag am using MS Access 2010. To use it in an SQL Statement youĬan create a user define function, for example Public Function getUserName() AS StringĪnd then use SELECT getUserName() AS UserName. Not 100% sure, but It does (and also in earlier version did) not work inside an SQL statement directly. You should be able to access all these environment variables with the Environ() method from VBA and from expressions. To check, what the environmentvariable contains open a command prompt and in there enter: Where doesn't it not work? In VBA, in an Expression or in a SQL Statement? Only difference: You have to write Environ('UserName') (' instead of ')