Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
ACC2000: How to Place the User Logon Name in a Control on a Form or in the Title Bar of the Microsoft Access Window
Article ID: 210591 - View products that this article applies to.
This article was previously published under Q210591
Advanced: Requires expert coding, interoperability, and multiuser skills.
This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).
This article shows you how to display the current user name in a control on a form or in the title bar of the Microsoft Access window.
You can use the Microsoft Access security features to control user access to different objects in your database. Then you can use the CurrentUser() function to get the name of the user who is currently logged in.
Displaying the User Name in a Control on a FormTo display a user name in a control on a form, follow these steps:
Displaying the User Name in the Title BarNOTE: The sample code in this article uses Microsoft Data Access Objects. For this code to run properly, you must reference the Microsoft DAO 3.6 Object Library. To do so, click References on the Tools menu in the Visual Basic Editor, and make sure that the Microsoft DAO 3.6 Object Library check box is selected.
To display a user name in the title bar of the Microsoft Access window, follow these steps: