Access Differnent Forms Based on User Name and Password

Meanmyrlin

New member
Local time
Today, 10:17
Joined
Jan 9, 2008
Messages
9
I have searched the forum and found posts that almost answer my question but as an inexperienced user I need a bit more direction.

I have a table called UserNameandPassword which lists the UserName, Password, and Organization for all users of my application. There are multiple Users (i.e. UserNames and Passwords) for each Organization.

I have a login screen where you enter your User Name and Password. There is an OK and a Cancel button included on this form.

I have three different forms and I would like one form to open based on the Organization. For example if the User Name is User1 (and that is associated with Organization1) I want Form1 to open, if the User Name is User2 (which is Organization2) I want Form2 to open etc. They will also need to input the correct password for the UserName they enter.

How is this accomplished? I have tried altering many of the suggestions posted by people with similar problems and I can't seem to make this work.

Any help would be greatly appreciated.

Thanks.
 
You could use a select case statement

strUser=me.textbox

select case strUser

case is = User1
docmd.openform "user1
case is =User2
docmd.openform "user2
...
 
Thank you for your reply. I gave this a try but I still can't make it work. How does this statement look up the password and organization associated with each user? I have no experience working with user names and passwords and I apologize for the need for a step by step explanation.
 

Users who are viewing this thread

Back
Top Bottom