How launch proper form depending on user's login

Am working with an old Access database which utilizes Users and Groups Permissions.

Is there a way to make one of two forms open when the user logs in depending on that user's login?

I'm already using this code to determine the user:

If DBEngine.Workspaces(0).Users(CurrentUser).Name = "Shop" Then
blah, blah, blah
end if

If the user is "Shop" then I want a particular form to open.  If it's any other user then I want another particular form to open.

--Steve
SteveL13Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
If DBEngine.Workspaces(0).Users(CurrentUser).Name = "Shop" Then

    docmd.openform "form1"

else

       docmd.openform "form2"
end if
0
SteveL13Author Commented:
Where would this code go?  In the inopen event of form2?

(I'm not at my computer now or I would try it)
0
Rey Obrero (Capricorn1)Commented:
you can place the code in a click event of a button in your login form.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

SteveL13Author Commented:
The login form is the "canned" login form from MS using Users and Groups.  I'm not sure I have control over it, do I?
0
Rey Obrero (Capricorn1)Commented:
where is this code located

If DBEngine.Workspaces(0).Users(CurrentUser).Name = "Shop" Then
blah, blah, blah
end if
0
SteveL13Author Commented:
On a form that is launched from a dashboard "Main Menu" named frmMainMenu.  frmMainMenu is opened by default as determined by File/Options/Current Database/Display Form.
0
Rey Obrero (Capricorn1)Commented:
do you want to open either "form1" or "form2"  from frmMainMenu ?
0
SteveL13Author Commented:
That's not what should work.  The way I need it to work is to have either form1 OR form2 open depending on the user login.

If the user is "shop" then form2 should open.  That would be their Main Menu or dashboard.

If the user is any other than "shop" then form1 should open.  That would be their Main Menu or dashboard.
0
Rey Obrero (Capricorn1)Commented:
do you have a form that opens before the "Dashboard" is shown?
0
SteveL13Author Commented:
Yes...  frmMenuLauncher
0
Rey Obrero (Capricorn1)Commented:
Can you edit the form?
0
SteveL13Author Commented:
Yes.
0
Rey Obrero (Capricorn1)Commented:
then place the codes in the click event of a button in frmMenuLauncher
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.