limit the amount of forms to certain people (1 Viewer)

rainbows

Registered User.
Local time
Today, 03:38
Joined
Apr 21, 2017
Messages
425
i have about 36 forms of which there are 6 processes within the company , sales , purchasing , production etc ,
is it possible that when say sales log into their area only their 6 forms would show in the navigation form ?

thanks steve
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:38
Joined
May 7, 2009
Messages
19,246
the simplest i think is to Disable the Navigation button that is not relevant to their Section.
 

Ranman256

Well-known member
Local time
Today, 06:38
Joined
Apr 9, 2015
Messages
4,337
I have a tUsers table with their login I’d, and their ‘level’.
userID,Level
bsmith, M
tJones, U

normal user, manager, admin

when the app opens, the main menu grabs the ID ,then looks up the level,
then disables buttons some users cant get to.

Code:
sub Form_Load()
txtUser = Environ("Username")  

sLevel = Dlookup("[Level]" , "tUsers","[UserID]='" & txtUser & "')

select case sLevel
    case "U"
      btnAdmin.enabled = false

    case "M"
      btnAdmin.enabled = true
end select
end sub
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:38
Joined
Sep 21, 2011
Messages
14,396
I just used a modified switchboard and a few Tempvars to store required data.
All I added was a UserLevel field to the switchboard table.

Code:
    TempVars("EmployeeID").Value = Me.cboEmployeeID.Column(0)
    TempVars("Employee").Value = Me.cboEmployeeID.Column(1)
    TempVars("UserLevel").Value = DLookup("DataOrder", "tblLookup", "LookupID = " & Me.cboEmployeeID.Column(3))
    DoCmd.OpenForm "Switchboard"
    DoCmd.Close acForm, strFormName

Source for switchboard.

SELECT *
FROM [Switchboard Items]
WHERE ((([Switchboard Items].ItemNumber)>0) AND (([Switchboard Items].SwitchboardID)=[TempVars]![SwitchboardID]) AND (([Switchboard Items].UserLevel)>=[Tempvars]![UserLevel]))
ORDER BY [Switchboard Items].ItemNumber;
 

bastanu

AWF VIP
Local time
Today, 03:38
Joined
Apr 13, 2010
Messages
1,402
My approach is to store the user access rules in a custom system table (prefixed with "usys") in the back-end itself. That way making changes to what users can see and do in the forms is simply adding\editing data instead of adding\editing code.
Cheers,
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 06:38
Joined
Feb 19, 2002
Messages
43,418
Here is a sample of a custom switchboard.

 

Users who are viewing this thread

Top Bottom