How to use system username directly in MS Access query?

前端 未结 4 1515
萌比男神i
萌比男神i 2020-11-28 15:57

I would like to know if there is a way to get system username and use it directly in an MS Access query. I have made a parameter work within a query from a combo box on a fo

4条回答
  •  南笙
    南笙 (楼主)
    2020-11-28 16:41

    Yes - you can use the 'CurrentUser' function in your query. Here I've included it as a field and criteria.

    SELECT Field1, Field2, [CurrentUser] AS UserName FROM Table1 WHERE Field1 = [CurrentUser];
    

提交回复
热议问题