lock navigate pane in ms access

时间:2017-04-06 16:45:16

标签: ms-access access-vba ms-access-2010

We are working on a project in MS-Access 2010, where users will be using switchboard as a main menu for navigation and will work in forms. We protected each form with login and password so the user can only access his/her records in a form (using vba macro inside MS-Access).

Now we would like to lock the control pane so noone can access objects like tables and queries. Does anyone have an idea how to do it in MS-Access?

Thanks for any ideas.

3 个答案:

答案 0 :(得分:1)

主页>选项> CurrentDatabase>

取消选中“使用访问权限特殊密钥”

取消选中“显示导航窗格”

也许还有:

取消选中“允许完整菜单”

取消选中“允许默认快捷菜单”

构建自定义功能区

确保用户不了解shift键旁路或分发可执行ACCDE

答案 1 :(得分:0)

如果您希望以编程方式执行此操作,那么这将执行此操作:

Call DoCmd.LockNavigationPane(True)

但是,你可能最好隐藏导航窗口,并在6月7日之后遵循一些建议。

答案 2 :(得分:0)

一个简单的解决方案就是在表单打开事件中将表单模式属性设置为true,就像这样:

    Private Sub Form_Open(Cancel As Integer)
       ' Go Modal to Lock Navigation Pane
       Me.Form.Modal = True
       ' Hide Navigation Pane
       DoCmd.NavigateTo "acNavigationCategoryObjectType"
       DoCmd.RunCommand acCmdWindowHide
       ' Hide Ribbon
       DoCmd.ShowToolbar "Ribbon", acToolbarNo
    End Sub

将表格设置为Modal可能并不适合所有情况,但是如果您有一个启动/总机样式表格可以打开所有其他表格,那么这可能是您的解决方案。