Security Control Ms Access Databases

Hi Experts

Is there a way to hide some of the controls on the ribbon by relating to user rights?

For example  if my user right is just to process sales Accounting then other controls relating to financial accounting must not be visible. I have a ribbon which carries the following:

(1) Sales Accounting
(2) Purchases Accounting
(3) Financial Accounting
(4) Fixed Asset Accounting
(5) Budgeting
(6) Payroll
(7) Inventory

As you can see there is need for segregation of duties above. The above ribbon is not visible at start up form , it is only visible when all the login formalities are done.

Regards

Chris
LVL 2
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.ScDirectorAsked:
Who is Participating?
 
John TsioumprisSoftware & Systems EngineerCommented:
I know than you can control enabled/disabled ...for visibility...
Put the following in a module (gEnabled is a global variable)
Option Compare Database
Private m_ribbon As IRibbonUI
Public Sub ToolEnabled(control As IRibbonControl, ByRef enabled)
  Select Case control.Id
    Case "TheIDOf TheControlYou WantToControl"
enabled = gEnabled
    Case Else
    enabled= True
    End Select
End Sub

Public Sub OnMainLoad(Ribbon As IRibbonUI)

  Set m_ribbon = Ribbon
End Sub
Public Property Get MainRibbon() As IRibbonUI
On Error Resume Next
  'global property that re-exposes the ribbon system-wide
  'so consumers can call the IRibbonUI.Invalidate method as required
  Set MainRibbon = m_ribbon
End Property

Open in new window

Then on the form you wish to enable it
 gEnabled = True
        MainRibbon.Invalidate

Open in new window

0
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.

All Courses

From novice to tech pro — start learning today.