I have a database that has a login screen for users to access the forms within it. When a user logs in, I want the name they logged in under to force that name onto any form they use. Is there a way to do this?
There is lots of different ways. One way is to save this to a public variable in a standard module, and build a function that returns the variable. You can use the function in a calculated control of a form
public strUserName as string
public function getUserName() as string
getUserName = strUserName
end function
It will be if you want to persist it through forms.
You can declare a variable in that module you created and set it to the entered username on a successful login. You can then use that variable through out your code to populate the form details you want.
Hope this helps
HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
Do you have a button on your login form that the user selects after entering his/her name and password? Just store the user name from there into the public variable suggested by MajP.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.