Re: Shortcut menus and VBA
- From: FBxiii <FBxiii@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 4 Apr 2005 01:23:02 -0700
It is an Access application.
I am new to manipulating toolbars so please bear with me :)
Once I have set references to "YourotherControl" which is a sub menu called
Update Status, how do I Add or Delete the required controls?
I am guessing I need to loop through each control on the menu, delete it,
then recreate the new one, but cannot seem to work the code out to do so.
Could you please provide an example? (The code provided has taken me a step
closer to my goal :)
Cheers,
Steve.
"Scott McDaniel" wrote:
> Is this an Access application you're trying to manipulate, or VB?
>
> If it's Access, then I'm assuming you're trying to get to manipulate your
> toobar or other menu. To do that, use code like this:
>
> dim cbr As CommandBar
> dim cbp As CommandBarPopup
>
> set cbr = CommandBars("MPR_Queue_Menu")
> Set cbp = cbr.Controls("YourOtherControl")
>
> Of course if the menu control you're looking for isn't a popup you'd have to
> change Object types. Also, you'll have to have a reference set to the Office
> Objects library ...
>
> "FBxiii" <FBxiii@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:4D7AAF4C-5232-45AA-8AB5-10F9F714B19E@xxxxxxxxxxxxxxxx
> > Hi, this is a repost of an earlier question, but hopefully explained a bit
> > better!
> >
> > I have created a shortcut menu for a list box called MPR_Queue_Menu.
> >
> > The menu has various options on it, including 2 'sub' menus.
> >
> > I need to know the code to set a reference to the shortcut menu and then
> > the
> > 2 specific sub menus I want to change.
> >
> > e.g.
> > Set cmdbar = Commandbars("MPR_Queue_Menu").FindControl(,,"Update Status")
> >
> > cmdbar.Edit
> >
> >
> > And then Add or Delete options to the sub menu as necessary.
> >
> > The available options will be retrieved from a recordset, according on
> > which
> > 'Queue' is visible at the time.
> >
> > Creating the options on the menu and hiding or showing them appropriately
> > is
> > not feasable as depending on what is shown in the list box will depend on
> > the
> > available options.
> >
> > My question is, how do I edit the controls shown on the sub menu within
> > the
> > shortcut menu in VB6?
> >
> > I have tried various ways using my VB6 knowledge and consulted the
> > Knowledge
> > base, but nothing seems to be clear...
> >
> > Many thanks in anticipation,
> > Steve.
> >
> >
>
>
>
.
- References:
- Shortcut menus and VBA
- From: FBxiii
- Re: Shortcut menus and VBA
- From: Scott McDaniel
- Shortcut menus and VBA
- Prev by Date: Re: Access code error - Too few parametres. Expect 1.
- Next by Date: how to set first field to autonumber ?
- Previous by thread: Re: Shortcut menus and VBA
- Next by thread: Access code error - Too few parametres. Expect 1.
- Index(es):
Relevant Pages
|