control toolbars & menus

  • Thread starter Thread starter VilMarci
  • Start date Start date
V

VilMarci

Hi,

Is there any way to control the display of certain toolbars (buttons) or
menus?
I know the startup option but I'd like to handle it more smoother...

I mean I'd like to display them based on NT userID-s. Getting the userID is
not a problem what I need is like:

Set a variable to eg. 1-5 based on on a table Permission.
userID,Permission
dsfa,1
dsfd,4

Then run a funcion like DisplayMenuSet(Permission)

Is this possible?

Thanks,
VilMarci
 
VilMarci,

Using a startup form's OnLoad event, you can remove all commandbars and
restore custom commandbars. You could also use an if-else statement too:

Private Sub Form_Load()

'==================================================
'DATE:
'AUTHOR:
'COMMENTS:
'
'1) Removes all Microsoft Access built-in toolbars.
'==================================================

Dim vUserName As String

vUserName = fOSUserName() 'Module Captures User Login Name

If vUserName = "SomeLoginName" Then

Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i

CommandBars("MyCustomMenu").Enable = True

Else 'Do Nothing
End If

End Sub

Best regards,

Todd
 
Back
Top