以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  条码满足性判断  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=79766)

--  作者:黑苹果
--  发布时间:2016/1/8 15:14:00
--  条码满足性判断
表数据
职务:经理 请假天数:5

预设条件:

1,职务=‘员工’ and 请假天数<=1
2,职务=‘员工’ and 请假天数>1 and 请假天数<=3
3,职务=‘员工’ and 请假天数>3
4,职务=‘经理’ and 请假天数<=1
5,职务=‘经理’ and 请假天数>1 and 请假天数<=3
6,职务=‘经理’ and 请假天数>3

则如何判断出是条件6为满足条件的?
[此贴子已经被作者于2016/1/8 15:34:14编辑过]

--  作者:大红袍
--  发布时间:2016/1/8 15:22:00
--  

If e.DataRow("职务") = "经理" AndAlso e.DataRow("天数") > 3 Then

    msgbox("6")

End If


--  作者:黑苹果
--  发布时间:2016/1/8 15:34:00
--  
不能是这样的逻辑,这样处理不好操作。 是要如何依次判断1-6哪个条件是否满足
--  作者:大红袍
--  发布时间:2016/1/8 15:35:00
--  

分别判断啊

 

If e.DataRow("职务") = "经理" AndAlso e.DataRow("天数") > 3 Then

    msgbox("6")

End If

 

If e.DataRow("职务") = "经理" AndAlso e.DataRow("天数") <= 1 Then

    msgbox("4")

End If


--  作者:大红袍
--  发布时间:2016/1/8 15:44:00
--  

如果你要用字符串,你就用动态编译的方式。

 

Functions.remove("函数")
Dim Code As String
Code = "msgbox(123)" & vbcrlf
Functions.Add("函数",Code)
Functions.Complie()
Functions.Execute("函数")