B
bpearson
I have a query about displaying a popup custom menu bar in Access 2003.
Well, by query what I mean is that I can't get it to work ...
I have created the new CommandBar to drop down off the main menu. [It's
effectively a popup menu plus cascading sub-menus to open most of the
screens within the application.] This all works fine.
I then want to display the same menu as a popup from various other
places within the app. This just doesn't seem to want to work at all.
My code is effectively as follows ...
Dim MyCmdBar as CommandBar
Set MyCmdBar = CommandBars("My main
cmdbar").Controls("&Screens").CommandBar.Controls("Other screens
....").CommandBar
MyCmdBar.ShowPopup
When I call this code from a command button on a form, I get the error
message "Method 'ShowPopup' of Object 'CommandBar' failed".
However if I insert the line
MsgBox Str$(MyCmdBar.type=msoBarTypePopup)
in my code it displays the answer 'True', which suggests to me that it
is (a) a valid CommandBar object and (b) it is of a type which supports
the ShowPopup method.
Any ideas?
Brian Pearson
Mace Limited
London
Well, by query what I mean is that I can't get it to work ...
I have created the new CommandBar to drop down off the main menu. [It's
effectively a popup menu plus cascading sub-menus to open most of the
screens within the application.] This all works fine.
I then want to display the same menu as a popup from various other
places within the app. This just doesn't seem to want to work at all.
My code is effectively as follows ...
Dim MyCmdBar as CommandBar
Set MyCmdBar = CommandBars("My main
cmdbar").Controls("&Screens").CommandBar.Controls("Other screens
....").CommandBar
MyCmdBar.ShowPopup
When I call this code from a command button on a form, I get the error
message "Method 'ShowPopup' of Object 'CommandBar' failed".
However if I insert the line
MsgBox Str$(MyCmdBar.type=msoBarTypePopup)
in my code it displays the answer 'True', which suggests to me that it
is (a) a valid CommandBar object and (b) it is of a type which supports
the ShowPopup method.
Any ideas?
Brian Pearson
Mace Limited
London