Disappearing items on Custom Menus

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created a custom menu in my Access database. It is visible all the time. Every now and then, the items on this custom menu mysteriously disappear. I then have to re-create them. To create the menu items, I am just using the Customize Toolbars dialog box and draggin my items into my custom menu. Does anyone have any suggestions on how I can prevent the menu items from disappearing ? It has happened 3 times to me.

Thanks in advance.

Neil.
 
You can create a procedure/function to create custom menu
and run it every time You load main form.

Here is an example:

Sub TestMenuItem()
MsgBox "Hello"
End Sub

Function CreteCustomMenu()
Dim cb As CommandBar
Dim ctr As CommandBarControl

DelCustomMenu

Set cb = CommandBars.Add(Name:="ASDFG",
Position:=msoBarTop) 'normal mode
'Set cb = CommandBars.Add(Name:="ASDFG",
Position:=msoBarTop, MenuBar:=True) 'to overide menu
'Set cb = CommandBars.Add(Name:="ASDFG",
Position:=msoBarTop, MenuBar:=True, Temporary:=True) 'to
overide menu and delete on close application

Set ctr = cb.Controls.Add(Type:=msoControlButton)
With ctr
.Caption = "Test it"
.FaceId = 512
.OnAction = "TestMenuItem"
End With
cb.Visible = True

Set cb = Nothing
Set cb = Nothing
End Function


Sub DelCustomMenu()
On Error Resume Next
CommandBars("ASDFG").Delete

End Sub


-----Original Message-----
I have created a custom menu in my Access database. It
is visible all the time. Every now and then, the items on
this custom menu mysteriously disappear. I then have to
re-create them. To create the menu items, I am just using
the Customize Toolbars dialog box and draggin my items
into my custom menu. Does anyone have any suggestions on
how I can prevent the menu items from disappearing ? It
has happened 3 times to me.
 
You are creating your own menu bars, and NOT customizing the built in
ones...right?

If you accident customize the built in ones, then when you re-set, or even
change the mdb application you run, you risk changing what/how those
tool/menu bars work.

You should be creating your own menu bars. Further, if you change the
built-in ones, then you can't really copy them to another database as you
can when you build your own.

Other then that, I have no idea why your problem would be occurring.
 
Back
Top