SteveL13
asked on
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).Use rs(Current User).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
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).Use
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
ASKER
Where would this code go? In the inopen event of form2?
(I'm not at my computer now or I would try it)
(I'm not at my computer now or I would try it)
you can place the code in a click event of a button in your login form.
ASKER
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?
where is this code located
If DBEngine.Workspaces(0).Users(Current User).Name = "Shop" Then
blah, blah, blah
end if
ASKER
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.
do you want to open either "form1" or "form2" from frmMainMenu ?
ASKER
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.
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.
do you have a form that opens before the "Dashboard" is shown?
ASKER
Yes... frmMenuLauncher
Can you edit the form?
ASKER
Yes.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
docmd.openform "form1"
else
docmd.openform "form2"
end if