default shortcut menus

G

Guest

Is there a way to disable and enable the default shortcut menus in Visual
Basic? I've created several custom toolbars for the users of my database,
but I still need full access to all built-in toolbars and menus. The problem
I am having currently is that the startup page for my users is a form
containing a subform. I have set the shortcut menu to my custom toolbar I
created. However, when right clicking in the subform, I still receive the
default shortcut menu. I need to have the default shortcut menus enabled at
startup so that I can have access to them, but not allow the users access
when right-clicking the subform. Can I set a custom shortcut menu to the
subform? Or will I need to find another method around this problem?

Any help would be wonderful!
 
R

Rick Brandt

KatK said:
Is there a way to disable and enable the default shortcut menus in
Visual Basic? I've created several custom toolbars for the users of
my database, but I still need full access to all built-in toolbars
and menus. The problem I am having currently is that the startup page
for my users is a form containing a subform. I have set the shortcut
menu to my custom toolbar I created. However, when right clicking in
the subform, I still receive the default shortcut menu. I need to
have the default shortcut menus enabled at startup so that I can have
access to them, but not allow the users access when right-clicking
the subform. Can I set a custom shortcut menu to the subform? Or
will I need to find another method around this problem?

Any help would be wonderful!

Disable shortcut menus in Startup. When *you* open the file hold the shift
key down which disables all startup options.
 
G

Guest

Thanks for your suggestion. However, I will ultimately be disabling the
shift bypass key so others will not bypass my settings as well. Is there any
method to set a custom shortcut menu to a subform? Thanks for the help.
 
R

Rick Brandt

KatK said:
Thanks for your suggestion. However, I will ultimately be disabling
the shift bypass key so others will not bypass my settings as well.
Is there any method to set a custom shortcut menu to a subform?
Thanks for the help.

Every form has a shortcut menu property. If you set that to the name of
your shortcut menu then that is the shortcut menu they will see. You'll see
that property on the { Other } tab of the property sheet.
 
G

Guest

But if I set the form's shortcut menu to my custom menu for users, when I
open the database, the form's shortcut menu will be the custom menu, not the
default shortcut menu I need access to. Therefore, I am right back where I
started.
 
R

Rick Brandt

KatK said:
But if I set the form's shortcut menu to my custom menu for users,
when I open the database, the form's shortcut menu will be the custom
menu, not the default shortcut menu I need access to. Therefore, I
am right back where I started.

Why do you need access to a different shortcut menu than the users? I
suppose you could leave the shortcut menu property in design view empty, but
set its value in the form's open event.

Do you give your users an MDE file? Your code could test to see if the last
three characters of CurrentDB.Name are "MDE" and then change the shortcut
menu property, but leave it alone if the last three characters are "MDB".
Alternatively, you could test the name of the computer or the name of the
network logon acount and do something different if either of those indicate
it is YOU running the app instead of a normal user.
 
G

Guest

First, I'm sorry if I haven't been very clear with my problem, so I will
explain what I am trying to do the best I can. In my database, the users
will have access to only the main startup page. On this page there is a
subform. The user selects the appropriate form from a drop down box, and
this form appears in the subform.

I want to have access to the default shortcut menus for this main page, but
I do not want the users to have access to these default shortcut menus
because then they will be able to access design view and my database will not
be secure. Therefore, I created a custom shortcut menu. I used the
ShortcutMenuBar Property to replace the default shortcut menu with my custom
menu when a "user" opens the database. My code checks user-level by tables I
set up myself. I have "Allow Default Shortcut Menu" checked under
Tools\Startup so when I open the database I will have the default shortcut
menus. Everything works fine, except when a "user" right-clicks in the
subform, the default shortcut menu appears, not the custom shortcut menu I
created.

How can I set the subform's shortcut menu to my custom menu? I have tried
using the ShortcutMenuBar Property for the subform, but it doesn't work. My
database has not been distributed yet because it needs to be fully secure
beforehand. Your last suggestion describes how I have things set up, but I'm
not sure where to go from here. I've tried everything I can think of!

I am fairly new to programming with Visual Basic, so maybe I am making this
harder than it is?
 
R

Rick Brandt

KatK wrote:
[snip]
How can I set the subform's shortcut menu to my custom menu? I have
tried using the ShortcutMenuBar Property for the subform, but it
doesn't work.
[snip]

Did you set the Shortcut Menu property of the subform *control*? That won't
do it. You need to set the ShortcutMenu property of EVERY form that will be
displayed in the subform control.

By the way. You could just distribute the app to your users as an MDE file
and then they would not be able to view or change the design of any of the
code based objects (forms, reports, modules).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top