以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 切换用户 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=180245) |
-- 作者:lxmoffice -- 发布时间:2022/10/10 16:17:00 -- 切换用户 老师, 您好! 我在LoadUserSetting里面设置了以下代码, 目的是想到切换用户后根据用户权限重新加载数据, 但测试切换用户后这些代码不执行, 不知为何? 麻烦指点. 谢谢! Dim d1 As Date = User.ExtendedValues("开始日期") Dim d2 As Date = User.ExtendedValues("结束日期") If user.isrole("部门预算") And User.Group = "CNC部" Then DataTables("预算总表").LoadFilter = "[预算年份] >= " & d1.year & " And [预算年份] <= " & d2.year & " and [预算部门] =\'CNC部\'" DataTables("预算细分").LoadFilter = " [预算年份] >= " & d1.year & " And [预算年份] <= " & d2.year & "And [预算部门] = \'CNC部\'" ElseIf user.isrole("部门预算") And User.Group = "生产部" Then DataTables("预算总表").LoadFilter = "[预算年份] >= " & d1.year & " And [预算年份] <= " & d2.year & " And [预算部门] = \'生产部\'" DataTables("预算细分").LoadFilter = "[预算年份] >= " & d1.year & " And [预算年份] <= " & d2.year & " And [预算部门] = \'生产部\'" ElseIf user.isrole("部门预算") And User.Group = "抛光部" Then DataTables("预算总表").LoadFilter = "[预算年份] >= " & d1.year & " And [预算年份] <= " & d2.year & " And [预算部门] = \'抛光部\'" DataTables("预算细分").LoadFilter = "[预算年份] >= " & d1.year & " And [预算年份] <= " & d2.year & " And [预算部门] = \'抛光部\'" Else DataTables("预算总表").LoadFilter = "[_Identify] Is Null" DataTables("预算细分").LoadFilter = "[_Identify] Is Null" DataTables("预算使用").LoadFilter = "[_Identify] Is Null" End If |
-- 作者:有点蓝 -- 发布时间:2022/10/10 17:20:00 -- 只是设置了加载条件,没有调用加载的代码,最后加上 DataTables("预算总表").Load DataTables("预算细分").Load DataTables("预算使用").Load |
-- 作者:lxmoffice -- 发布时间:2022/10/10 18:04:00 -- 啊!是我粗心大意了 谢谢老师!
|