MS Access 2010 Runtime - Missing Right Mouse Click Context Menu in continuous forms

烈酒焚心 提交于 2019-12-10 13:47:15

问题


I have written an application in MS Access 2003. I can run this using Access 2010, however when I open the same 2003 application with the MS Access 2010 Runtime only, I can no longer use the Right Mouse Click in a continuous form (as I can with the full version) to filter by selection or to sort data etc. Has anyone else encountered this situation? Is this a purposeful design of Access 2010? If so, does anyone know why the Right-Click Content Menu is not working? Otherwise - is it a normal part of the Runtime 2010 and my application is the problem?


回答1:


The Runtime unfortunately doesn't have context menu enabled, however, you can re-create some of it for your application.

For instance, in mine, I create a basic copy/cut/paste context menu like this:

'-----------------------------------------------------------------------------'
' General Clipboard context menu, the basis for all forms                     '
'-----------------------------------------------------------------------------'
Public Function CreateGeneralClipBoardMenu()
    On Error Resume Next
    CommandBars("GeneralClipboardMenu").Delete

    Dim cmb As CommandBar
    Set cmb = CommandBars.Add("GeneralClipboardMenu", msoBarPopup, False, False)

        With cmb
            .Controls.Add msoControlButton, 21, , , True  ' Cut
            .Controls.Add msoControlButton, 19, , , True  ' Copy
            .Controls.Add msoControlButton, 22, , , True  ' Paste
        End With

    Set cmb = Nothing
End Function

Just call this code once at the start of your application and the context menu will be available everywhere.

The Need a list of msoControlButton Ids thread on MSDN shows how to similarly add Sorting and filter options.




回答2:


The standard context menus do not work with the Access runtime version. I have seen this effect with Access runtime versions 2003, 2007 and 2010.



来源:https://stackoverflow.com/questions/8574642/ms-access-2010-runtime-missing-right-mouse-click-context-menu-in-continuous-fo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!