Access开发培训
网站公告
·Access专家课堂QQ群号:151711184    ·Access快速开发平台下载地址及教程    ·欢迎加入Access专家课堂微信群!    ·如何快速搜索本站文章|示例|资料    
您的位置: 首页 > 技术文章 > Access2007

access2007功能区开发-modRibbonPrivate模块

时 间:2009-09-08 00:03:09
作 者:朱亦文   ID:61  城市:岳阳
摘 要:Access2007功能区开发-modRibbonPrivate模块
正 文:

Option Compare Database
Option Explicit
'----------------------------------------------------------
'modRibbonPrivate模块 : 与modRibbonPublic模块配合使用
'相关 : clsRibbon类/clsRibbonControl类/modRibbonPublic模块
'日期 : 2009.05.02
'作者 : 朱亦文
'目的 : 设置指定功能区的回调函数,要动态改变属性,必须单独
'       指定回调
'----------------------------------------------------------
'例:Main功能区
'<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" loadImage="LoadImages" onLoad="onRibbonLoad">
'  <ribbon startFromScratch="true">
'    <tabs>
'      <tab id="tabHome" label="任务面板">
'        <group id="grpMessage" label="消息">
'          <button id="btnMessage" label="最新消息" size="large" getImage="Main_GetImage" tag="message.png" onAction="onButtonClick" />
'          <separator id="sepMessage1" />
'          <labelControl id="labUnit" getLabel="Main_GetLabel" />
'          <labelControl id="labUser" getLabel="Main_GetLabel" />
'          <labelControl id="labDate" getLabel="Main_GetLabel" />
'        </group>
'      </tab>
'    </tabs>
'  </ribbon>
'</customUI>
'建议 : 回调函数的命名:功能区名称_公共回调函数名称
'       功能区 : Main
'       getImage回调
'       名称定义: Main_GetImage

Public Sub Main_GetLabel(control As IRibbonControl, ByRef Label)
    Call GetLabel("Main", control, Label)
End Sub
Public Sub Main_GetImage(control As IRibbonControl, ByRef image)
     Call GetImage("Main", control, image)
End Sub
Public Sub Main_OnActionButton(control As IRibbonControl)
'    MsgBox control.id & " " & control.Tag
   
    Select Case control.id
    Case "btnHome":             DoCmd.OpenForm "首页"
    Case "btnQuit"
        If CurrentProject.AllForms("登录").IsLoaded Then DoCmd.Close acForm, "登录"
        DisconnectDB
        DoCmd.Quit
    Case "btnWEB":              DoCmd.OpenForm "浏览器"
    Case "btnWEBcj":            DoCmd.OpenForm "网上长江海事"
   
    Case "btnSecurityExternal": DoCmd.OpenForm "外部安全监管网"
   
    Case "btnDockList":         DoCmd.OpenForm "渡口"
    Case "btnDockReport":       DoCmd.OpenReport "渡口信息卡", acViewPreview
   
    Case "btnShipList":         DoCmd.OpenForm "客渡船"
    Case "btnShipsReport":      DoCmd.OpenReport "渡船信息卡", acViewPreview
    Case "btnShipsSecValid":    DoCmd.OpenForm "船舶FSC检查"
    Case "btnShipMenList":      DoCmd.OpenForm "船员"
    Case "btnShipMenEval":      DoCmd.OpenForm "船员评估"
   
    Case "btnFirstReport":      DoCmd.OpenForm "首班报告"
    Case "btnLastReport":       DoCmd.OpenForm "末班报备"
    Case "btnSMSSend":          DoCmd.OpenForm "发布手机短信"
    Case "btnSendList":         DoCmd.OpenForm "发送列表"
    Case "btnRecieveList":      DoCmd.OpenForm "接收列表"
   
    Case "btnGPSWindow":        DoCmd.OpenForm "GPS监控"
    Case "btnGPSRecord":        DoCmd.OpenForm "GPS监控记录"
   
    Case "btnDockFieldChart":   DoCmd.OpenForm "渡口地域分布图", acFormPivotChart
    Case "btnDockFieldTable":   DoCmd.OpenForm "渡口地域分布表"
   
    Case "btnShipsT":           DoCmd.OpenForm "渡船主机吨位"
    Case "btnShipsFieldChart":  DoCmd.OpenForm "渡船地域分布图", acFormPivotChart
    Case "btnShipsFieldTable":  DoCmd.OpenForm "渡船地域分布表"
    Case "btnShipsFSCCount":    DoCmd.OpenForm "渡船安检缺陷统计表"
    Case "btnShipMenEvalCount": DoCmd.OpenForm "船员评估统计表"
    Case "btnShipsSMSBGSum":    DoCmd.OpenForm "渡船有效首班报告统计表"
    Case "btnShipsSMSBBSum":    DoCmd.OpenForm "渡船有效末班报备统计表"
   
    Case "btnEvalItemSet":      DoCmd.OpenForm "船员评估项目管理"
    Case "btnEvalMananger":     DoCmd.OpenForm "船员评估管理"
    Case "btnPlaceMananger":    DoCmd.OpenForm "地名"
    End Select
'    Call testRibbon
End Sub



Access软件网QQ交流群 (群号:54525238)       Access源码网店

常见问答:

技术分类:

相关资源:

专栏作家

关于我们 | 服务条款 | 在线投稿 | 友情链接 | 网站统计 | 网站帮助