limit the amount of forms to certain people

rainbows

Registered User.
Local time
Today, 11:01
Joined
Apr 21, 2017
Messages
428
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
 
the simplest i think is to Disable the Navigation button that is not relevant to their Section.
 
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
 
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;
 
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,
 

Users who are viewing this thread

Back
Top Bottom