北京 | 上海 | 天津 | 重庆 | 广州 | 深圳 | 珠海 | 汕头 | 佛山 | 中山 | 东莞 | 南京 | 苏州 | 无锡 | 常州 | 南通 | 扬州 | 徐州 | 杭州 | 温州 | 宁波 | 台州 | 福州 | 厦门 | 泉州 | 龙岩 | 合肥 | 芜湖 | 成都 | 遂宁 | 长沙 | 株洲 | 湘潭 | 武汉 | 南昌 | 济南 | 青岛 | 烟台 | 潍坊 | 淄博 | 济宁 | 太原 | 郑州 | 石家庄 | 保定 | 唐山 | 西安 | 大连 | 沈阳 | 长春 | 昆明 | 兰州 | 哈尔滨 | 佳木斯 | 南宁 | 桂林 | 海口 | 贵阳 | 西宁 | 乌鲁木齐 | 包头 |
Private Sub ctExplorer1_lbItemClick(ByVal nList As Integer, ByVal nItem As Integer)
On Error GoTo TC_Err
Dim func As String, mdl As String
With ctExplorer1
'点击时自动打开相应的功能,相应的功能 已经保存在项目的lbItemCargo属性中
If Not IsNull(ctExplorer1.lbItemCargo(nList, nItem)) Then
mdl = ctExplorer1.lbItemCargo(nList, nItem)
'调用openCmd打开相应功能(窗体或报表或函数)
OpenCmd mdl
Exit Sub
End If
End With
Exit Sub
TC_Err:
glMessageBox "错误:" & Err.Description
Exit Sub
End Sub
'根据参数打开对应的窗体/报表/函数
Public Sub OpenCmd(mdl As String)
On Error GoTo OC_Err
Dim rs As ADODB.Recordset, func As String
DoCmd.Hourglass False
Set rs = New ADODB.Recordset
rs.Open "SELECT ModuleID from tblZstmProgItem", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
rs.Index = "ModuleID"
rs.Seek "=", mdl
If DCount("func", "tblSysRightUserRight", "uname='" & LogUser & "' and func='" & mdl & "'") = 0 Then
glMessageBox "你没有权限使用这个功能!"
Exit Sub
End If
If Not IsNull(rs!Form) Then
gOpenForm rs!FInModule, rs!Form
'DoCmd.OpenForm rs!Form
Exit Sub
Else
glMessageBox "此操作不存在!"
Exit Sub
End If
If Not IsNull(rs!Qry) Then
gOpenQuery rs!FInModule, rs!Qry
'DoCmd.OpenQuery rs!Qry
Exit Sub
Else
glMessageBox "此操作不存在!"
Exit Sub
End If
If Not IsNull(rs!func) Then
func = rs!func & "()"
UnUsed = Eval(func)
Exit Sub
Else
glMessageBox "此操作不存在!"
Exit Sub
End If
Exit Sub
OC_Err:
glMessageBox "tmsoft" & Err.Description
Exit Sub
End Sub