设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 750|回复: 3
打印 上一主题 下一主题

[Access本身] 关于菜单的废止问题

[复制链接]
跳转到指定楼层
1#
发表于 2005-5-19 02:37:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
大家帮我看看这个阿,在操作员登录时,只有查询和退出菜单可用,其他都是灰的,系统管理员登录时所有菜单都可用

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅

点击这里给我发消息

2#
发表于 2005-5-19 08:08:00 | 只看该作者
使用类似下面的函数:
Public Function AllowMenus(CmdBarName As String, CmdbarEnabled As _
   Boolean)

   '============================================================='
   'This function has two arguments: CmdbarName is a string that '
   'passes the name of the command bar that the code enables or  '
   'disables. CmdBarEnabled is a Boolean value in which you pass '
   '"True" or "False" in order to enable or disable the command  '
   'bar being modified.                                          '
   '                                                             '
   'Example: To disable the command bar "NorthwindCustomMenuBar" '
   'in the Northwind sample database, use the following:         '
   '                                                             '
   'AllowMenus("NorthwindCustomMenuBar",False)                   '
   '============================================================='

   Dim Cmdbar As CommandBar, Cbct As CommandBarControl

   On Error GoTo Err_AllowMenus
   Set Cmdbar = CommandBars(CmdBarName)

   If Cmdbar.Visible = False Then Cmdbar.Visible = True

      For Each Cbct In Cmdbar.Controls
         Cbct.Enabled = CmdbarEnabled
      Next Cbct

   Exit_AllowMenus:
      Exit Function

   Err_AllowMenus:
   MsgBox "Error " & CStr(Err) & " " & Err.Description & _
      " has occurred in the AllowMenus Function", vbOKOnly, _
      "Error Detected"
   Resume Exit_AllowMenus

End Function
使用方法: AllowMenus("你的工具条名", False)
以上函数摘自微软,详细原文请参照:
http://support.microsoft.com/?kbid=202308
3#
 楼主| 发表于 2005-5-20 05:08:00 | 只看该作者
这个只能废止全部阿,我有时还要废止子菜单的阿
4#
 楼主| 发表于 2005-5-20 05:25:00 | 只看该作者
access2003没有Commandbar属性阿
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-9-21 12:38 , Processed in 0.081845 second(s), 29 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表