Hide all Access Toolbars and Menubars

  • Thread starter Thread starter Dixie
  • Start date Start date
D

Dixie

Guest
With reference to this post:

ghudson said:
An added bonus is the right-click mouse button option is disabled if the menu bars are disabled with the above code.[/COLOR]
Can you enable the right click mouse menu as I normally want this one plus a custom menu in my applications. I like the idea of being able to disable all menus, then enable the ones you want, but I need the right click mouse menu.
 
Last edited by a moderator:
4000+ views and no answers!

Hi Folks,

A bit of a bump on this one: I have exactly the same question that Dixie posted a couple of years ago that hasn't been answered:

Is there a way to enable the mouse right click menu when all the toolbars have been disabled using the code ghudson supplied? I'm using A2003 & Win XP which may well be relevant.

In my case, reports are shown in preview mode and users use the right click for printing/exporting options. I suspect that I could create a custom menu to do the same thing but it would be nice to use the built in code. :)
 
Hide toolbars and menus

Hi..

This is my method...

PHP:
'Login to setup other menu screens 
'---------------------------- 

Private Sub Form_Load() 

'hide toolbars/menu/rightclick 
Dim i As Integer 
For i = 1 To CommandBars.Count 
CommandBars(i).Enabled = False 
Next i 

'Hide maindb window 
DoCmd.SelectObject acTable, , True 
DoCmd.RunCommand acCmdWindowHide 

'only show 1 taskbar window 
Application.SetOption "ShowWindowsinTaskbar", False 

If CurrentUser = "Admin" Then 'or change "Admin" if required 
Dim ii As Integer 
For ii = 1 To CommandBars.Count 
CommandBars(ii).Enabled = True 
Next ii 

'unhide Maindb window 
DoCmd.SelectObject acTable, , True 

End If 

End Sub


Hope it helps....
 
Keith Nichols said:
Is there a way to enable the mouse right click menu when all the toolbars have been disabled using the code ghudson supplied? I'm using A2003 & Win XP which may well be relevant.

In my case, reports are shown in preview mode and users use the right click for printing/exporting options. I suspect that I could create a custom menu to do the same thing but it would be nice to use the built in code. :)
How do you keep the users from accessing the "design" of your database objects if they are able to right-click on your reports? Protecting the data and the design of the database objects should be a high priority with your application.
 
Mike,

Thanks for the code. I will try this tomorrow.

ghudson said:
How do you keep the users from accessing the "design" of your database objects if they are able to right-click on your reports? Protecting the data and the design of the database objects should be a high priority with your application.

ghudson,

My application is in a relatively low risk contained office environment with distributed front ends and a common back end. If users trash their front end, I can get them to clear the version number which forces a re-load from the network next time they attempt to log in.

As it is, I am far and away the "most knowledgeable" in the office, where access is concerned at least (scary I know). Everyone seems to come to me if they want the database to do something that it doesn't already.

I have a master front end archived in a hidden network directory and the development copy on my PC. The back end is regularly backed up and users can't open it anyway, other than through the front end.

In this situation, my only real concerns are that the database is robust, that the interface is as easy as possible for users to work and that it looks good. Up until now the toolbars have not been hidden and I have had no problems associated with this so I am really only hiding them to make it look better.
 
asking the wrong question and getting the wrong answer

mikebaldam,

Your code works fine so thanks for that. It did not solve the problem I thought I had directly but it did put me on the right track. :)

GHudson,
your comments in your original post misled me with a 'trap for new players':

Originally Posted by ghudson
An added bonus is the right-click mouse button option is disabled if the menu bars are disabled with the above code.[/color]

This got me to thinking there was a property of the mouse right click that could be enabled/disabled and this is what I was asking to help to do.

When I finally got round to looking at this again, I realize that this is not the case; it is just that the right click pop up menus are menus as well and so they are disabled. Doh!!! :rolleyes:

Once I had that insight, I was able to look at my problem with fresh eyes. The actual menu I wanted was 'Print Preview' and I think the following code would have enabled it:

Code:
CommandBars("Print Preview").Enabled = True

However, I created a custom toolbar and enabled that instead.

For those that follow, here is how you create a pop up menu, associate DB objects with it and then enable it after all other menus have been disabled.

Create a custom toolbar
View / Toolbars / Customize access the command bar menu
New create toolbar and name it
Properties set type to pop-up
Close properties dialogue
Select 'Shortcut Menus' from Tool bar list
Drag and drop commands to your menu in the 'custom' menu of the shortcut toolbar


Use the code below to enable the new menu when the DB opens, i.e. run this after the code that disables all menus.

'Enable the custom menu
CommandBars("YourShortCutMenuNameHere").Enabled = True

Open the objects the menu is to be associated with in design view. Open the properties dialogue and go to the 'Other' tab. In the 'Shortcut Menu' field, select your toolbar (it will be the only item in the list).

Next time you open the DB, the popup will be available via a right click when the DB object is open.

As was (is!?!?) often the case in my queries on this forum, I was asking the wrong question and so the I hope this saves a bit of head scratching for those that follow.

Regards,
 

Users who are viewing this thread

Back
Top Bottom