Creating a menu on Access 2007 form

A

Azonei

I have some code that I have used for several years that will add a
menu bar to an Access form. The code no longer works in Access 2007.
In a nutshell, the Form_Open event is used to call the CreateMenu(),
CreatePopupMenu(), AppendMenu(), SetMenu(), and DrawMenuBar() API
functions. I have stepped through the code and found everything to be
working, but the menu just won't display. It works fine in Access
2003 and earlier.

Please note that this is a menu directly on the form, not a CommandBar
or Ribbon. The application I am creating does not show the Access
window at all and therefore the menu has to be directly on the form.
I know it can be done (or it used to be doable) because I've done it
for about 5 years...it just doesn't seem to work in 2007. (And yes I
know all of the potential problems associated with subclassing in
Access and how/why it is potentially unstable, etc.)

I found that the Form has to be a Popup window in order for the menu
to be displayed in earlier versions of Access, but this doesn't seem
to have any effect in 2007. If this property is not set, the form
window is a child of the MDI window and simply won't display its own
menu. Is there something in Access 2007 that keeps the form an MDI
child even with this property set? More importantly, can I get around
it?

I've been toying with the idea of just adding buttons to the window
and displaying a popup menu on the click event, but this really isn't
practical. By using a menu system, I don't have to redesign the
interface when a menu item is added or removed, I don't have to know
how many menu items will be used, and the people using the app can
manage the menus themselves, etc.

If anyone can shed some light on what has changed in Access 2007 to
prevent the menu from being shown, I would appreciate the insight.

Azonei
 

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

Similar Threads

CreateMenu() 7
CreateMenu() 1
Popups in Access 2007 2
Custom Ribbons in Access 2007 5
User Access Menu 10
Access 2007 help file 1
Access 2007 - Hiding the Menu Bar 2
compact database in VBA access 2007 5

Top