以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  timertick统计的问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=87539)

--  作者:douglas738888
--  发布时间:2016/7/13 11:22:00
--  timertick统计的问题
请教老师,以下代码写在TIMERTICK,加了窗口打开的条件,count的统计数,要在打开窗口后才能统计,要实现及时统计,根据条件来看,好像只能在该窗口内使

用正本表,  如果用SQL_Table表,必须要写打开窗口的条件,不然报错;是否还有其他办法在使用SQL_Table表的时候,又能及时COUNT统计

If forms("投标商务审批意见").Opened Then
Dim pbx165 As WinForm.PictureBox = e.Form.Controls("PictureBox24")
Dim lbl165 As WinForm.Label = e.Form.Controls("Label165")
If lbl165 IsNot Nothing Then
   Dim Count165 As Double
   Count165 = Tables("投标商务审批意见_Table1").DataTable.Compute("Count(项目编号)","执行人 Like  \'%" & _UserName & "%\' and (收阅确认 not Like \'%" & _UserName & "%\' or 收阅确认 Is null) and 审批流程 Like \'%编制程序_编制%\'")
   If Count165 = 0 Then
        pbx165.ImageFile = "GGreen.ico" \'显示图片
    ElseIf Count165 >= 1 Then 
        pbx165.ImageFile= "RRed.ico" \'显示图片
    End If
lbl165.Text = "" & Count165 & ""
   End If
End If

--  作者:大红袍
--  发布时间:2016/7/13 11:26:00
--  

 直接对主表进行统计,添加加上对应的限制条件即可。