Full Version: Auto Insert User Name
UtterAccess Forums > Microsoft® Access > Access Forms
Sorry for the dig (referring to this old thread). Need help on the same subject, iam nearly stuck in the same area where poster was. i alos have tried with =GetUser but it tells computer name and system info, i need to cature the ID whih i give it during login.

Welcome to UtterAccess!

Can you post a copy of your db?
How do you assign the ID during Login?
Iam going to rephrase my question.
In my DB i've created userlogin table and form, once you open the DB it'll prompt to enter user name and password. Now i want to use this user name in all my forms. For example a userA logged into the DB now any entery in any form will get that userA name. For the purpose i've created an unbound text box on every form, i've tried GetUser() in default value, also have tried Environ() but to no avail. Any help in this regard will be highly appriciated.
Jeff B.
If your app is prompting for userID & p/w, one option might be to add code into the routine you have that validates that userID & p/w. The new code would set a TempVar value, which you could then use anywhere in your app. (Note: you would NOT need to add a textbox to every form ...)
Thanks Jeff.B. can you kindly tell me step by step procedure. and secondly if i exclude the unbound text box from every form then how'll i knw that which user had done the entry.
Access does not have a built in way of capturing a user name. So YOU had to code something to prompt the user to enter a name and password. We don't know how you did it. So we can't provide you with instructions. You have to look at what your form does.

You might want to search UA's Wiki on Login Security with VBA. There is a Wiki that offers instructions on how to create and use a login form and how to capture the user.
Jeff B.
Have you looked into TempVars?
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.