问题描述
你好,
我的第一篇文章所以请保持温和:)
My first post so please be gentle :)
我有一个访问程序,其中有三个不同的计算机/用户在表格中输入新记录。我想知道在字段中使用 用户标记每条记录的最佳方法,以便可以过滤表格以仅显示一个用户的条目。
我知道它可以通过他们输入的字段手动完成,但如果它是根据输入的计算机自动完成的话会更好。 可以在启动程序并存储时输入变量需要时参考?
I have an Access program where three different computers/ users enter new records into a table. I would like to know the best way to tag each of these records with the user in a field, so that the table can be filtered to show just one user's entries. I know it can be done manually with a field that they would enter but it would be nicer if it was done automatically based on the computer doing the input. Can a variable be entered when they start their program and stored to reference when needed?
提前感谢您的建议
Dave
推荐答案
UserName = Environ("USERNAME")
您还可以使用Windows API检索经过Windows身份验证的用户:
You can also use the Windows API to retrieve the Windows authenticated user:
https://stackoverflow.com/questions/677112/how-to-get-logged-in-users -name-in-access-vba
这篇关于Access 2013识别用户的新记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!