如何设置只读自定义菜单栏 [英] How to set read only custom menu bar

查看:83
本文介绍了如何设置只读自定义菜单栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MSAccess中有一个自定义菜单栏(DeskOrgz>并且此菜单栏包含几个子菜单栏。我还有一个用户登录屏幕,其中用户按访问级别定义,例如管理员的''1''对于主管来说'2'',对于普通用户''3''。如果用户访问级别是3,我如何将所选菜单栏设置为只读。


谢谢。

解决方案


我在MSAccess中有一个自定义菜单栏(DeskOrgz>和这个菜单栏包含几个子菜单栏。我还有一个用户登录界面,用户根据访问级别定义,例如1表示管理员,2表示主管,3表示普通用户。如果用户访问级别为3,则将所选菜单栏设置为只读。


谢谢。



将要隐藏的所有菜单项上的标记设置为1和类似下面的内容应该可以工作.MenuName是指每个菜单组的名称。

展开 | 选择 | Wrap | 行号


控件(MenuName)。CommandBar.Controls 部分行代码 For Each cbc In Application.Commandbars(" DeskOrgz")。Controls ?当我编译它时,我得到无效的过程调用参数。 (下面的代码)。


我把这个代码放在FORM LOAD上。


Private Sub Form_Load()

DoCmd.Maximize


Dim cbc As Object


每个cbc在Application.CommandBars(Pageant)。控件( TOP 8)。CommandBar.Controls

如果cbc.Tag =" 1"那么

cbc.visiblae = False

结束如果

下一个cbc

结束子


" Pageant"是菜单栏名称和TOP 8。是报告的子菜单。菜单。


谢谢。


先尝试一下......

展开 | 选择 | Wrap | 行号

I have a custom menu bar in MSAccess (DeskOrgz> and this menu bar contains several submenu bars. I also have a user login screen where the users are defined by level of access such as ''1'' for admin, ''2'' for supervisor, ''3'' for regular users. How do i set selected menu bars to be "read-only" if the user access level is "3".

Thanks.

解决方案

I have a custom menu bar in MSAccess (DeskOrgz> and this menu bar contains several submenu bars. I also have a user login screen where the users are defined by level of access such as ''1'' for admin, ''2'' for supervisor, ''3'' for regular users. How do i set selected menu bars to be "read-only" if the user access level is "3".

Thanks.

Set the tag on all the menu items you want to hide as 1 and something like the following should work. MenuName refers to the name of each menu group.

Expand|Select|Wrap|Line Numbers


Is the Controls("MenuName").CommandBar.Controls part of the line code For Each cbc In Application.Commandbars("DeskOrgz").Controls? When I compile it i''m getting "Invalid Procedure call argument" (code below).

I''m putting this code on FORM LOAD.

Private Sub Form_Load()
DoCmd.Maximize

Dim cbc As Object

For Each cbc In Application.CommandBars("Pageant").Controls("TOP 8").CommandBar.Controls
If cbc.Tag = "1" Then
cbc.visiblae = False
End If
Next cbc
End Sub

"Pageant" is the menu bar name and "TOP 8" is the sub-menu of "Reports" menu.

Thanks.


Try this first ...

Expand|Select|Wrap|Line Numbers


这篇关于如何设置只读自定义菜单栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆