How can I hide all command bars (menu & toolbars) for readonly use

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an application that has a user with readonly permissions.

I want to hide all menu bars, toolbars etc for that user

How can I do this?

Kind regards

Ross Petersen
 
Ross,

I've posted this elsewhere, but you can use the OnLoad event of a form using
a little VBA to do just this, you could just remove them for a specific user
if you'd like:

Private Sub Form_Load()

'==================================================
'DATE: November 10, 2004
'AUTHOR: Todd L. Shillam
'COMMENTS:
'
'1) Removes all Microsoft Access built-in toolbars.
'==================================================

Dim vUser As String
vUser = Environ$("UserName") 'COULD USE GETUSERNAME API INSTEAD

If vUser = YOURUSERNAME Then

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

Else
End If

End Sub
'END OF SUBROUTINE

Best regards,

Todd
 
Ross,

If you want, you can take out the if-else statement--that will remove all
toolbars, menus, etc. from the application for all users:

Private Sub Form_Load()

'==================================================
'DATE: November 10, 2004
'AUTHOR: Todd L. Shillam
'COMMENTS:
'
'1) Removes all Microsoft Access built-in toolbars.
'==================================================

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

End Sub
'END OF SUBROUTINE

Best regards,

Todd
 
Todd

I've just found this one from you and have tested and understood how you
took out all the toolbars. I can't figure out though how you put in the
user log names for the code below to work

Dim vUser As String
vUser = Environ$("UserName") 'COULD USE GETUSERNAME API INSTEAD

If vUser = YOURUSERNAME Then

I have tried setting the database password and user password from the tools
option on the main database window, but cannot see how to get this going.

Could you please advise me on this.

Many thanks

Peter
 
Back
Top