Having very hard time with 'msoControlButtonPopup' :(

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

Guest

Hi,

I use a lot of shortcut menus in my database. I create these
programmatically using CommandBars.

I would like to create a submenu that pops up but that also has a graphic
beside it. To my understanding, MS provides the Type:=msoControlButtonPopup
for just that.

Problem is, when I do ...Controls.Add(Type:=msoControlButtonPopup) I get an
error message. Everywhere I have read says this is the proper syntax, yet I
have not seen even one example where someone is actually using it.

I know it's possible as I've seen this type of pop-up in built-in shortcuts
with Access.

This has been a VERY frustrating search. I mean, why would MS add
functionality to their product and NEVER EXPLAIN HOW TO USE IT? I mean I've
been to MSDN, I've been to the KB, I've been here. I've been over the whole
web. It simply says I can use it but never once shows HOW?

Maddening. Oh well, if anyone know PLEASE HELP!

M
 
Hi,

I use a lot of shortcut menus in my database. I create these
programmatically using CommandBars.

I would like to create a submenu that pops up but that also has a graphic
beside it. To my understanding, MS provides the Type:=msoControlButtonPopup
for just that.

Problem is, when I do ...Controls.Add(Type:=msoControlButtonPopup) I get an
error message. Everywhere I have read says this is the proper syntax, yet I
have not seen even one example where someone is actually using it.

I know it's possible as I've seen this type of pop-up in built-in shortcuts
with Access.

This has been a VERY frustrating search. I mean, why would MS add
functionality to their product and NEVER EXPLAIN HOW TO USE IT? I mean I've
been to MSDN, I've been to the KB, I've been here. I've been over the whole
web. It simply says I can use it but never once shows HOW?

Maddening. Oh well, if anyone know PLEASE HELP!
do you have a reference to MS Office?
if not use 12 (it's the number of the variable msoControlButtonPopup)
 
Hi Andi,

Here's a sample of my code. I am creating a Shortcut Menu for my Job Form:

Public Function fAddMenuJob_()
Dim MyBar As CommandBar
Dim MenuData1 CommandBarPopup

CommandBars("MenuJob_").Delete

'Menu: Data1
Set MenuData1 = MyBar.Controls.Add(Type:=msoControlButtonPopup)
With MenuData1
.Caption = "Menu: Data I"
.BeginGroup = True
End With
'Add Menu: Data1 Menu
Call fAddMenuJob_Data1_(MyBar)

End Function


Ok, now when I try to run this to create the menu, I get an 'invalid
procedure' message that goes to the 'msoControlButtonPopup'. If I use '12'
there i get the same message. If I change it to 'msoControlPopup' it works
fine. But that doesnt give me the menu 'and' the graphic I'm looking for.

Any ideas?

Mitchell


'Create Shortcut Menu:
Set MyBar = CommandBars.Add(Name:="MenuJob_", Position:=msoBarPopup,
Temporary:=False)
 
On Fri, 4 Feb 2005 06:05:04 -0800, "Bill Mitchell"

see inside
Hi Andi,

Here's a sample of my code. I am creating a Shortcut Menu for my Job Form:

Public Function fAddMenuJob_()
Dim MyBar As CommandBar
Dim MenuData1 CommandBarPopup

Dim MenuData1 As CommandBarPopup


on error resume next
CommandBars("MenuJob_").Delete
on error goto 0

set MyBar=CommandBars.add("MenuJob_", msoBarTop, True, True)
 
Andi,

I ran it with your code changes. I still get the "Invalid Procedure"
message. Have you run this and had it work, generating the
msoControlButtonPopup control?

Mitchell
 
Andi,

I ran it with your code changes. I still get the "Invalid Procedure"
message. Have you run this and had it work, generating the
msoControlButtonPopup control?
no I pressed send to early and I am to busy now

check google.groups for examples
 
Well, from the extensive research I've done on this, including Google, I have
determined that msoControlButtonPopup simply doesn't work. I've read a
number of posts from others expressing the same problem. It seems there are
a limited number of mso's that work with Access Control Bars, and the rest
have been created simply to frustrate us.

It's weird, because there are built-in menus that I can see very clearly use
the msoControlButtonPopup functionality, but when you try to code one
yourself, you get an error message.

Just one more gaping hole in Access MS apparently too busy to ever fix. Oh
well :(

M
 
Here is the final answer on this from someone in the Google Groups. His
comclusion is same as mine:

"Well. After banging my head on every nearby surface for a while today, I
think I've come up with the definitive answer for this one.

You can't.


(Note: I didn't promise that you'd LIKE the definitive answer <g>)


MS uses features in PPT that may not be exposed as part of the object model,
meaning that just because THEY can do it doesn't necessarily mean that WE
can do it. This appears to be one of those.


Turns out you can wander in through the back door with FindControl and learn
about the properties of any control on the menubar ... things like tags,
IDs, captions and Type all reveal themselves. The gadget off Action
Settings is a type 12 control, msoControl ... erm ... something or other
that I can't remember now that I'm at home and the notes are at work, fat
lotta good I am. But whatever it is, it's not on the list of types that MS
says you can use when rolling yer own controls. "

So, in other words, we JUST CAN'T.

Damn M$ for leaving stuff like this out. Man, I get so sick of constantly
running into crap like this that they leave out for no apparent reason. No
wonder they are quickly becoming a dinasoar.

Grrrr!

M
 
It's weird, because there are built-in menus that I can see very clearly use
the msoControlButtonPopup functionality, but when you try to code one
yourself, you get an error message.
tell me which menu it is and I will play around (if I get the time)
with api-calls. (then it might be posible)
 
Back
Top