How to Add a Right Click Menu to A Form in Access 2007 in the RunTime Environmane

S

Stewart Berman

Access 2007 -- Runtime

We are building an application that will be compiled and then run using MS Access 2007 Runtime.

To limit what the user can do outside of what the application provides we have turned off shortcut
menus in the database. However, we would like to provide the right click menu that is available in
a form opened in datasheet mode which provides:
&Copy
&Past
-------
&Sort A to Z
S&ort Z to AA
-------
C&lear filters
Text &Filters --> sub menu
-------
&Equals
Does &Not Equal
Con&tains
&Does Not Contain

I assume (bad word) that the above is a standard right click menu for Access 2007. Is there a way
to connect it to a form so that it is available to the user in the RunTime environment for specific
forms even if Allow Full Menus and All Default Shortcut Menus are unchecked?
 
M

Mark Andrews

If you build the popup menu via code and then call it from code it should
work in the runtime environment.
At least I'm 99% sure it does. I don't use the runtime much.

Easy to try a quick test. If you need code send me an email and I'll shoot
you some sample code of building popup menus and calling them (I'm sure you
can find example on the web too).

If the popup menu does show up in the runtime then it's down to just how do
I build this popup menu.

HTH,
Mark
 
S

Stewart Berman

Thanks for your response and offer.

I was able to build and save a custom shortcut menu in code.

Do you understand the object model? The CommandBars collection is a property of the Application not
the database yet when you add an item to the collection it is stored in the database.I didn't see
anything associated with the custom shortcut menu in any of the MSys tables.
 
M

Mark Andrews

I don't look into the MSys tables much, but in short your problem is solved
right?

I write a lot of code, do I understand everything about the object model and
it's inner working, probably not.

The code lives in the database and it relies on code in a DLL to render a
menu. Perhaps there is nothing in the MSys tables.

Mark
 
S

Stewart Berman

Thanks for your offer but I just built a popup menu editor -- it was faster than using Access 2003
to build the menu.

The only problem I have is that the editor -- which sits in a separate MS Access DB -- cannot show
the popup in the database it created it in via automation. It can only show it if it constructs it
in the editor DB.
 
S

Stewart Berman

menu. Perhaps there is nothing in the MSys tables.

But that would violate one of the rules (sorry at this point in the evening I can't remember the
name) -- everything in the database has to be described in data in tables. If MS is going around
that then the MS Access database is not "really" a database.

It is possible to walk the commandbars objects and create a set of tables that fully describe them.
It only takes two tables. I suspect MS is doing that but is not making the tables available even
when system and hidden objects is turned on. Probably part of their "Protect the User from Them
self" policy.
 
M

Mark Andrews

I would ask that question in another post (maybe an MVP knows the answer).
I don't think it's some kind of extra hidden table.
Mark
 

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