How to hide based on user access level?

pholt33

Registered User.
Local time
Today, 14:03
Joined
Dec 3, 2013
Messages
15
Hello,

I have a navigation form that has a navigation subform and then forms within that subform. I have figured out how to hide the main tab control based on user access but the subform tabs are still visible.

In the AdminHidden pic I attached, the Admin tab is hidden but the Reps, Customers, etc tabs on the admin subform are still visible.

How can I hide everything related to the Admin form and show only the Owner tab and its subform components?

Also, since the Admin tab is the leftmost tab, when it is hidden the Owner tab is it its original location rather than moving to the left. Is there a way to resize the admin tab so that the Owner tab is all the way left?
 

Attachments

  • AdminHidden.JPG
    AdminHidden.JPG
    14.9 KB · Views: 96
  • OwnerTab.JPG
    OwnerTab.JPG
    19.2 KB · Views: 95
i have a tUser table with their access right code.
when the form opens, enable items according to the code.

Code:
sub form_load()
vID = = Environ("Username")
vCode = Dlookup("[Rights]","tUsers","[userID]='" & vUser & "'"
select case vCode
   case "A"  'admin
       'all access
   case "M"  'manager
         btnAdmin.enabled = false
   case else
         btnAdmin.enabled = false
        btnMgr.enabled = false
end select
end sub
 
The way I did it was to have different main forms all named differently (all the same as each other but only certain tabs each) for each type of user and only have the tabs that are related to them and during login my code checks to see what access level they have and directs them to their own main form.

Maybe not the best way to do it but it was easy enough.
 

Users who are viewing this thread

Back
Top Bottom