以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]老大 问题依旧! 求助  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=18460)

--  作者:gaoyong30000
--  发布时间:2012/4/13 17:31:00
--  [求助]老大 问题依旧! 求助

在非“A卡录入”这个窗口使用“A卡录入_Table1”这个表的时候,加个判断,例如:


 

    Dim t As Table = Tables("A卡录入_Table1")

   Dim u As Table = Tables("A卡录入与审查_A卡录入与审查table1")

    With Tables("A卡录入与审查_A卡录入与审查table2")

        If .Current Is Nothing Then

            t.Filter = "False"

            u.filter = "False"

        Else

            t.filter = "编号 = \'" & .Current("编号") & "\'"

            u.filter = "编号 = \'" & .Current("编号") & "\'"

        End If

End With


 

改为:


 

If Table.Contains("A卡录入_Table1") Then

     Dim t As Table = Tables("A卡录入_Table1")

     Dim u As Table = Tables("A卡录入与审查_A卡录入与审查table1")

     With Tables("A卡录入与审查_A卡录入与审查table2")

         If .Current Is Nothing Then

              t.Filter = "False"

              u.filter = "False"

          Else

              t.filter = "编号 = \'" & .Current("编号") & "\'"

              u.filter = "编号 = \'" & .Current("编号") & "\'"

          End If

      End With

End If

 

还是没用~~~~~~~~~

 

还是找不到A卡录入_Table1


--  作者:狐狸爸爸
--  发布时间:2012/4/13 17:42:00
--  

用这个方法,跟踪一下错误代码位置:
 
http://www.foxtable.com/help/topics/1485.htm


 


--  作者:gaoyong30000
--  发布时间:2012/4/13 23:30:00
--  

在飞哥的帮助下解决了 方法和大家分享下

 

之前的代码为

e.Form.Controls("button01").enabled = Functions.Execute("shouquan","销售管理","A卡管理","A卡录入")

e.Form.Controls("button10").enabled = Functions.Execute("shouquan","销售管理","A卡管理","A卡录入")

e.Form.Controls("button8").enabled = Functions.Execute("shouquan","销售管理","A卡管理","A卡录入")

e.Form.Controls("button7").enabled = Functions.Execute("shouquan","销售管理","A卡管理","A卡录入") And Tables("A卡录入与审查_A卡录入与审查Table2").current("业务员申请") = "批准删除"
e.Form.Controls("button12").enabled = Functions.Execute("shouquan","销售管理","A卡管理","A卡录入")

e.Form.Controls("label8").enabled = Functions.Execute("shouquan","销售管理","A卡管理","A卡录入")

e.Form.Controls("combobox1").enabled = Functions.Execute("shouquan","销售管理","A卡管理","A卡录入")

 

结果 老是e.Form.Controls("button12").找不到  

 

最后的原因是  Functions.Execute("shouquan","销售管理","A卡管理","A卡录入") 多次调用  内部函数多次计算 结果导致运行慢的老电脑会出问题 找不到控件

 

最后先赋值Functions.Execute("shouquan","销售管理","A卡管理","A卡录入")  给变量  AKLR  

然后那些内部函数 替换成 AKLR  就解决了

[此贴子已经被作者于2012-4-13 23:30:33编辑过]