Can I customise the right mouse button in Access

E

efandango

Can I customise/place my own commands/event procedures on the right mouse
button? For example, I want to be able to send an email by selecting a field
by right clicking and then hit my 'send email' procedure.
 
M

Marshall Barton

efandango said:
Can I customise/place my own commands/event procedures on the right mouse
button? For example, I want to be able to send an email by selecting a field
by right clicking and then hit my 'send email' procedure.


The MouseUp event has arguments for the button and other
information. See VBA Help for details.
 
R

Rick Brandt

efandango said:
Can I customise/place my own commands/event procedures on the right
mouse button? For example, I want to be able to send an email by
selecting a field by right clicking and then hit my 'send email'
procedure.

You create a custom right-click menu and assign that menu to the object you
want to right-click on using the Shortcut Menu Bar property. On the custom
right-click menu you add an item that calls your Email routine.

If your have Access 2007 then I have no idea if any of the above still
applies. It does if you use 2007 to run an file created in an older
version, but I don't know if/how you can create custom right-click menus in
2007.
 
B

Bill

It can be a little confusing when creating custom
popup menus, as there's little help in Access on
the subject. First, like Rick, I can't speak for
2007, but the procedure is the same for 2000,
XP and 2003.

To begin, View -> Toolbars -> Customize. Then,
on the Toolbars tab, check "Shortcut Menus" and
click on new; name the shortcut menu in the ensuing
dialog box, e.g., MyR-Click. Then, immediately
choose "Properties" for the already selected new
"MyR-Click" toolbar. Click the down-arrow on
"Type" and choose "Popup" and then close the
properties dialog.

Once again, on the Toolbars tab, check "Shortcut
Menus" and notice the new toolbar that appears.
The far right option is "Custom". When you click on
"Custom", you'll see your new popup menu, and,
when you click on that you'll see that it is empty.

In the customize dialog, choose the "Commands"
tab and using both sides, find a command that
has an associated icon that you think best implies
a "send e-mail" action. When you find such a
command, drag it to your new popup menu and
then click on the new item and choose its properties.

Finally, in the "On Action" pane, put your function
name that you want to run, e.g., =MyFunction().
Fill in the remaining panes appropriate to what
you're wanting to accomplish with the popup.
Personally, I always include a "Screen Tip" so the
user gets a better idea of what it's all about.

The only other item is to associate the new popup
menu with a control. It can be a form, sub-form or
controls within the form or sub-form. Just look at
the properties of the control you're wanting to use
the right-click popup and enter the name of the
popup menu in the "Shortcut Menu Bar" field.

Bill
 
A

accesspuzzler

Quick question bill. What is the function you put for the "on action
command". Ive just got the 2 buttons at the moment, cut and paste. However,
they are not showing up. Could this be due to the fact that i am running all
the form windows as popups to remove the access windows and task bar?
 

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