Use of a custom commandbar in 2007, created in 2003

  • Thread starter jamcompany via AccessMonster.com
  • Start date
J

jamcompany via AccessMonster.com

Hi,

I have a custom menu bar that is in use for an A2003 application that I want
to make ready for 2007. One thing that I do in 2003 with the custom menu is
loop to change text, set things to visible/not visible, during the startup
form's OnOpen event. A text change might be displaying which version of
Access the person is using for the application. I might set a menu or sub
menu to visible, depending upon what I want to show the user upon startup.

I accomplish this using the commandbar object, then loop through each sub
menu for my custom menus, such as

Code:
------------------------------------------------------------------------------
--

For Each cb In CommandBars Select Case cb.Name Case
"Startup_MenuBar" cb.Visible = True For Each
cbctl In cb.Controls If cbctl.Caption = "File" Then
For Each cbctl2 In cbctl.Controlsetc...
------------------------------------------------------------------------------
--


...and this worked like a charm... until A2007

A little while back, I ran into a few issues disabling controls and affecting
the development menus in A2007. I got some insight on how to deal with custom
menus (using enable). I got other insight from the Access community,
basically that I should set AllowBuiltInToolbars and AllowFullMenus if I
don't want the ribbon or Office icon to show up when opening the app in A2007.


Now my problem...When I open the app in A2007 , with the AllowBuiltInToolbars
and AllowFullMenus set to false, I cannot edit my custom menu. I do lose the
ribbon, and the Office icon button. But the text will not update. The visible
property will not change from it's original value (if it's false, it stays
false even when setting it to true in code). So, even though my custom
toolbar will show up in A2007, I can't seem to get it fully functional.

Also, one additional note here... setting the AllowBuiltInToolbars and
AllowFullMenus options to true first, then to false after the desired change
to the custom menu, has no effect, since the properties of the database are
only set the next time the database opens.

Has anyone run into this hurdle with custom menus in A2007 and overcome it
through code, without using XML? Even though I will have to create a separate
accdb file for the A2007 version, I would like to have as little difference
as possible between the versions so I can more easily code for the two
versions of the app that I need to make.

Thanks in advance for your input!
 
J

jamcompany via AccessMonster.com

Sorry - the code got kind of jumbled...here it is again

For Each cb In CommandBars
Select Case cb.Name
Case "Startup_MenuBar"
cb.Visible = True
For Each cbctl In cb.Controls
If cbctl.Caption = "File" Then
For Each cbctl2 In cbctl.Controls
etc...
 

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