设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

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

[其它] 请高手解析一下代码

[复制链接]
跳转到指定楼层
1#
发表于 2004-8-27 16:51:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
这是我向网上高手学习权限时下载的模块代码,因本人只是读懂少部份内容,请高手帮我解析一下!

Function SetMainSwitchBoard()     

    Select Case UserType()

     Case "Other"

        MsgBox "You don't have access to payroll system!"

        DoCmd.Quit

   

    Case "HR_Operator"

        Application.SetOption "Built-In ToolBars Available", False

        Application.SetOption "Can Customize Toolbars", False

        DoCmd.ShowToolbar "MyToolBar", A_TOOLBAR_YES

        Application.SetOption "Key Assignment Macro", "MyKeyHandle"

        Application.MenuBar = "MyMenuBar"

        DoCmd.OpenForm "MainSwitchBoard_HR"

   

    Case "ayroll_Operator"

        Application.SetOption "Built-In ToolBars Available", False

        Application.SetOption "Can Customize Toolbars", False

        DoCmd.ShowToolbar "MyToolBar", A_TOOLBAR_YES

        Application.SetOption "Key Assignment Macro", "MyKeyHandle"

        Application.MenuBar = "MyMenuBar"

        DoCmd.OpenForm "MainSwitchBoard_Payroll"

   

    Case "Operator"

        Application.SetOption "Built-In ToolBars Available", False

        Application.SetOption "Can Customize Toolbars", False

        DoCmd.ShowToolbar "MyToolBar", A_TOOLBAR_YES

        Application.SetOption "Key Assignment Macro", "MyKeyHandle"

        Application.MenuBar = "MyMenuBar"

        DoCmd.OpenForm "MainSwitchBoard_admin"

   

    Case "Admin"

        Application.SetOption "Built-In ToolBars Available", True

        DoCmd.ShowToolbar "MyToolBar", A_TOOLBAR_YES

        Application.SetOption "Key Assignment Macro", "AutoKeys"

        Application.SetOption "Can Customize Toolbars", True

        DoCmd.OpenForm "MainSwitchBoard_Admin"

   

    Case "Vacation"

        Application.SetOption "Built-In ToolBars Available", False

        Application.SetOption "Can Customize Toolbars", False

        DoCmd.ShowToolbar "MyToolBar", A_TOOLBAR_YES

        Application.SetOption "Key Assignment Macro", "MyKeyHandle"

        Application.MenuBar = "MyMenuBar"

        DoCmd.OpenForm "MainSwitchBoard_Vacation"

   

    Case "Finance_Operator", "Finance_Inquiry"

        Application.SetOption "Built-In ToolBars Available", False

        Application.SetOption "Can Customize Toolbars", False

        DoCmd.ShowToolbar "MyToolBar", A_TOOLBAR_YES

        Application.SetOption "Key Assignment Macro", "MyKeyHandle"

        Application.MenuBar = "MyMenuBar"

        DoCmd.OpenForm "MainSwitchBoard_Journal"

    Case "Finance_Admin"

        Application.SetOption "Built-In ToolBars Available", False

        Application.SetOption "Can Customize Toolbars", False

        DoCmd.ShowToolbar "MyToolBar", A_TOOLBAR_YES

        Application.SetOption "Key Assignment Macro", "MyKeyHandle"

        Application.MenuBar = "MyMenuBar"

        DoCmd.OpenForm "MainSwitchBoard_Finance"

   

    Case "HR_Inquiry"

        Application.SetOption "Built-In ToolBars Available", False

        Application.SetOption "Can Customize Toolbars", False

        DoCmd.ShowToolbar "MyToolBar", A_TOOLBAR_YES

        Application.SetOption "Key Assignment Macro", "MyKeyHandle"

        Application.MenuBar = "MyMenuBar"

        DoCmd.OpenForm "MainSwitchBoard_HR_Inquiry"

   

    Case "ayroll_Inquiry"

        Application.SetOption "Built-In ToolBars Available", False

        Application.SetOption "Can Customize Toolbars", False

        DoCmd.ShowToolbar "MyToolBar", A_TOOLBAR_YES

        Application.SetOption "Key Assignment Macro", "MyKeyHandle"

        Application.MenuBar = "MyMenuBar"

        DoCmd.OpenForm "MainSwitchBoard_Payroll_Inquiry"

        

    Case Else

        MsgBox "You don't have access to payroll system!"

        DoCmd.Quit

   

    End Select

   

   

End Function

Function UserType()

On Error GoTo Err_userType

    Dim usrCurUser As User

    Dim oneGroup As Group

    Dim blnAdmin, blnInquiry, blnOperator, blnHR, blnPayroll, blnFinance, blnVacation, blnFinanceAdmin As Boolean

    Dim strResult As String

   

    'Set usrCurUser = CurrentUser()

   
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-15 12:35 , Processed in 0.077538 second(s), 24 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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