Code to Create Custom Right-Click Menu

  • Thread starter Thread starter Barry Skidmore
  • Start date Start date
B

Barry Skidmore

When a user right-clicks in a field on a form, they are presented with
a menu that includes options to filter, sort, show properties, and to
copy and paste. I would like to limit their options to only "Copy" and
"Paste".

I have eliminated the filter options by setting the form's "Allow
Filters" property to "No", however there is not an analogous property
setting for "Allow Sorting".

In researching this issue on Google, I have seen mention that there is
code available that allows one to construct custom menus that appear
when one right-clicks in Access, but unfortunately I can not locate
this code.

Thanks,
Barry
 
Actually, you don't need any code to create the right click menu.

Just create a new custom tool bar, in properties change it to a menu bar.

Then, steal the "Copy" and "paste" options from the regular edit menu from
the regular menu (use ctrl-drag..to "copy" these options).

Then, convert the menu to a shortcut menu. At this point, you are done, and
then you can simply specialty the right click menu for your form in the
"other" tab (the shortcut menu).

The above only takes 1 minute if you done this before..and it takes no code.

You can read up on creating menus here:
http://www.microsoft.com/Accessdev/articles/bapp97/chapters/ba01_6.htm

As mentioned...no code is needed here...it done via drag and drop...
 
Albert,

Thanks very much for the tip. I learned something very useful, and it
worked just as you described.

Barry
 
Back
Top