Well, this might be embarrassing for me. Based on what I just found in my old code, it looks like we can reference the menu bar menu item without knowing the name of the menubar. If that's the case, sorry, but maybe you picked up a smidgen of commandbar code knowledge in the process. Try this that I wrote for you (need I say on a copy of your db??) NameOfYourMenu is like "File" or whatever the menu name is for the menu you want to add to. If you want to underline a letter in the name of the menu ITEM you are adding so that keyboard shortcuts can be used (like File), use the ampersand in front of the letter you want to designate for the shortcut (&File). If the name of the existing menu that we are adding an item to already has a letter underlined (like File), that is part of the name and you must use it in your reference (e.g. Purchase Orders is Purchase O&rders).
You could make this a function if you wanted to add items without having to write code for each. You could pass the menu name, item name, caption, etc. to it.
Code:
Private Sub AddMenuItem()
Dim newItem As CommandBarControl
On Error GoTo errHandler
Set newItem = CommandBars("NameOfYourMenuItem").Controls.Add(Type:=msoControlButton)
With newItem
.BeginGroup = False 'creates, or not, a dividing line
.Caption = "Run A Query..."
.FaceId = 0
.OnAction = "RunAQuery" 'needs to be the name of a function, not a sub, that either runs the query, or calls the routine that runs it
End With
exitHere:
Exit Sub
errHandler:
Msgbox "Error " & Err.Number & ": " & Err.Description
Resume exitHere
End Sub