Access 2007 (Current User)

I used to use Access 2000, now our office has upgraded to Access 2007. I was told that rather than having a separate user list internal to the database to pull Current User based on the login and password entered, I could use the Windows login information instead. Is there a different built in function that will pull the computer login information rather than the DB access login. When I use (Current User) now it simply enters Admin in the field since no user login information is in the new database.

John, Thank you for the quick response. When I was using the Current User option before, I set the form to auto fill Current User into the Recieved By field.

Private Sub Form_Load()
[ReceivedBy] = CurrentUser()
End Sub

Can you clarify where I would need to enter the first portion of the Code you sent and if changing [RecievedBy] = NetUser() would result in the user setting being the Windows login name vise the Access login "Admin".

Since John is presumably sleeping, I'll chime in. You need to put the code into a new module, or an existing module that contains that sort of code. And the Declarations would go at the top of that module.

There is however another option to continue using the Access User Security as long as you are still working with an .MDB file. You can still connect to your old workgoup file, but you can't do it from the menu. You have to open the VB window and on the command line run code to open the dialog box for setting the workgroup file. I'll see if I can find the exact syntax, but at the moment I'm travelling. You can probably find it with a search as well.

Here's the code to activate the Workgroup Administrator

Code:

docmd.RunCommand acCmdWorkgroupAdministrator

Last edited by WendellB; 2012-03-30 at 10:50.
Reason: Add code to run Workgroup Administrator