right click pop-up menu

S

Souris

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
 
S

Souris

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,
 
S

Souris

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,
 
S

Souris

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.
 
S

Souris

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,
 
S

Souris

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.
 
S

Souris

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.
 
S

Souris

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.
 
S

Souris

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,
 
S

Souris

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

Souris

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,
 
S

Souris

Do you mean that my function name must be sometihng like '=QuickClose'

My code should look like following

private sub =QuickClose()

response = msgbox("hello", mbOK)

end sub

Your help is great appreciated,
 
R

Rick Brandt

Souris said:
Do you mean that my function name must be sometihng like '=QuickClose'

My code should look like following

private sub =QuickClose()

response = msgbox("hello", mbOK)

end sub

No, I mean you enter...

=QuickClose()

....as the menu action property.
 

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