right click pop-up menu

G

Guest

I just wanted to have a pop-up menu when user right click on the controls.
Where I can put the code to create right click event?
Are there any pop-up menu controls available to use?
Your informaiton is great appreicated,
 
R

Rick Brandt

Souris said:
I just wanted to have a pop-up menu when user right click on the
controls. Where I can put the code to create right click event?
Are there any pop-up menu controls available to use?
Your informaiton is great appreicated,

You create a custom menu and make its type "Popup". Then you go to the
properties of the desired control and set its ShortcutMenuBar property to
the name of your custom Popup menu. You'll find that property on the
{Other} tab of the property sheet.
 
G

Graham R Seach

Souris,

Sure you can have a context menu pop up when you right-click a control, and
you put such code in the control's MouseDown event.

If (Button = acRightButton) Then
CommandBars("popMyPopup").ShowPopup
End If

You'll need to add a reference to the Microsoft Office Object Library for
your version.

<<Are there any pop-up menu controls available to use?>>
I don't know what you're really asking here, but if you want a custom popup
menu, you'll have to create it yourself. Before you do that, you need to
decide what you want it to do.

Once you have a popup menu you want to use, instead of coding your own
MouseDown event to show the popup, you can just set the control's
ShortcutMenuBar property to the name of the popup.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
G

Guest

Thanks for the message,
Are there any document to create a custom menu?
I went to view --> toolbars--> customize --> command --> move the new menu,
but I need a menu to drop the sub menu.

I think that I need create a main menu, before create a popup menu.

Any information is great appreciated,
 
G

Guest

I tried dragdrop the new menu on my menu bar. I have a new menu on my access
menu bar.

How can I take out from my Access menu?
I have one extra new menu after help menu.

thanks millions,
 
G

Guest

Are there any menu components or controls on the tool bar box to drag and
drop on the form and just have my menu code on the click event?

If I need create popup menu myself. Are there any procedure to do this?
Thanks,
 
R

Rick Brandt

Souris said:
I tried dragdrop the new menu on my menu bar. I have a new menu on my
access menu bar.

How can I take out from my Access menu?
I have one extra new menu after help menu.

Not sure I undersand the question. If you set the Type of the new menu to
"Popup" which is required if you want to use it as a Shortcut menu then it
would not be possible for it to be docked at the top of your screen as Popup
menus can't be displayed there.
 
R

Rick Brandt

Souris said:
Are there any menu components or controls on the tool bar box to drag
and drop on the form and just have my menu code on the click event?

If I need create popup menu myself. Are there any procedure to do
this? Thanks,

Right click on any existing menu or toolbar and choose "Customize". Once
the customize tools are displayed you will have options for creating "New"
menus and toolbars.
 
G

Guest

I went to View --> Toolbars --> customerize --> Command tab--> New menu
Catogory --> Drap dorp new menu on the Access menu

Right now there is a "new menu" beside the help,

It is not what I wnat. There is no option to let me take it out.

Please help. Thanks millions,
 
G

Guest

Does this option apply any version of Access?
I do not have theoption create new menu pr tool bars.
I wanted to have my popup menu on the user form.
For example, I want to add a 'Close' menu on the form.
User may right click on user form to execute 'Close' command.

Delphi has a popup menu components to drop on the form and just put the code
in the event and link the components to the controls.

Are there any similar methos to do the work?

Thanks millions,
 
R

Rick Brandt

Souris said:
I went to View --> Toolbars --> customerize --> Command tab--> New
menu Catogory --> Drap dorp new menu on the Access menu

Not on the Command Tab. On the Toolbars tab is a [ New... ] button. That
is what you want.

As for the other menu you accidentally created locate it in the Toolbars
tab, select it, and then press the [ Delete ] button.
 
G

Guest

It creates a toolbar.
Does it equal a popup menu?
I do not see any property to change it to popup menu.

Thanks agian,


Rick Brandt said:
Souris said:
I went to View --> Toolbars --> customerize --> Command tab--> New
menu Catogory --> Drap dorp new menu on the Access menu

Not on the Command Tab. On the Toolbars tab is a [ New... ] button. That
is what you want.

As for the other menu you accidentally created locate it in the Toolbars
tab, select it, and then press the [ Delete ] button.
 
R

Rick Brandt

Souris said:
It creates a toolbar.
Does it equal a popup menu?
I do not see any property to change it to popup menu.

After you create it initially then you can select it in the Toolbars list on
the { Toolbars } tab and then press the [ Properties ] button. The
resulting dialog lets you change it to a Popup menu.
 
G

Guest

Thanks again,

I have shortcut menu, can you please tell me how to add the code to excute
when user right click on the form. Thanks again,

Rick Brandt said:
Souris said:
It creates a toolbar.
Does it equal a popup menu?
I do not see any property to change it to popup menu.

After you create it initially then you can select it in the Toolbars list on
the { Toolbars } tab and then press the [ Properties ] button. The
resulting dialog lets you change it to a Popup menu.
 
R

Rick Brandt

Souris said:
Thanks again,

I have shortcut menu, can you please tell me how to add the code to excute
when user right click on the form. Thanks again,

No code is required. Both the form itself and the controls on the form have a
ShortcutMenu property. Just enter the name of your menu in that property and it
will be displayed upon a right-click.

If you want the menu to appear no matter where they right-click, then use the
Shortcut Menu property of the form. If you only want them to see it when they
right-click on certain controls then enter it as the Shortcut property of those
controls.
 
G

Guest

Do you mean that I can not customize the popup menu?
If it is the case, how do I have a cusomize code for my form.
For example: I want to a poppup menu call 'show Account number'?

I would like to run 'MsgBox('This is Account ' & MyAccount, mbOK)'

Can I do this or not?

Thanks millions,
 
R

Rick Brandt

Souris said:
Do you mean that I can not customize the popup menu?

Where in my post did you get that idea? I was explaining how to get your custom
shortcut menu to be displayed in your app. What your custom menu *does* is
entirely up to you when you create it.
If it is the case, how do I have a cusomize code for my form.
For example: I want to a poppup menu call 'show Account number'?

So create such an item on your custom shortcut menu.
I would like to run 'MsgBox('This is Account ' & MyAccount, mbOK)'

Can I do this or not?

Absolutely. As you add items to your menu you assign them an action that can
point to a custom function that can do anything possible in VBA code (or you can
call a macro).
 
G

Guest

Do you mean that I may have action name as my VBA function name?
The popup menu will call the VBA code.
Thanks again,
 
G

Guest

My action dropdown does not have anything available to select.
I write a subroutine like following but it does not work

Private sub QuickClose()
Response = MsgBox("I am Here", mbOK)
End sub

I point the action to QuickClose, but I got "can not find macro" message
from MS Acess.

I think I missinfg asomething to lnik my function and action.

Can you please help me where I am missing here?
Thanks millions,
 
R

Rick Brandt

Souris said:
My action dropdown does not have anything available to select.
I write a subroutine like following but it does not work

Private sub QuickClose()
Response = MsgBox("I am Here", mbOK)
End sub

I point the action to QuickClose, but I got "can not find macro"
message from MS Acess.

I think I missinfg asomething to lnik my function and action.

Can you please help me where I am missing here?
Thanks millions,

For VBA functions you need an = sign in from of the function name.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top