以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 代码编写 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=107989) |
-- 作者:jygyyl -- 发布时间:2017/10/13 18:02:00 -- 代码编写 Select Case e.DataCol.Name Case
"年龄","在读" If
e.DataCol.Name = "在读" Then
and “年龄”>18 e.DataRow("GS603") = 100
\'年龄大于18,但属于在读则补助金额为100 If e.DataRow.IsNull("在读") Then and “年龄”<18 e.DataRow("GS603") = 100
\'年龄小于18则补助金额为100 Else \'否则 e.DataRow("GS603") = 180 End
If End
If End Select “年龄”小于18,“GS603”=100; “年龄”大于18,“GS603”=180; “年龄”大于18,但“在读”为真时,“GS603”=100 要实现上述目标,代码如何编写,求专家指点 |
-- 作者:有点甜 -- 发布时间:2017/10/13 18:10:00 -- Select Case e.DataCol.Name Case "年龄","在读" If e.DataCol.Name = "在读" AndAlso e.DataRow("年龄")>18 Then e.DataRow("GS603") = 100 \'年龄大于18,但属于在读则补助金额为100 ElseIf e.DataRow("年龄")<=18 Then e.DataRow("GS603") = 100 \'年龄小于18则补助金额为100 ElseIf e.DataRow("年龄")>18 Then e.DataRow("GS603") = 180 End If End Select |
-- 作者:jygyyl -- 发布时间:2017/10/13 19:03:00 -- 谢谢 Select Case e.DataCol.Name Case "在读" If e.NewValue = True Then e.DataRow("GS602") = 100 Else e.DataRow("GS602") =180 End If Case "年龄" If e.DataRow.IsNull("年龄") Then e.DataRow("GS602") = Nothing ElseIf e.DataRow("年龄")<=18 Then e.DataRow("GS602") = 100 \'年龄小于18则补助金额为100 Else e.DataRow("GS602") =180 End If End Select 这样可以实现“年龄”不能为空,“在读”改变为“假”是按年龄取值
|
-- 作者:有点蓝 -- 发布时间:2017/10/13 20:21:00 -- 1、“年龄”不能为空,参考:http://www.foxtable.com/webhelp/scr/0624.htm,看示例五 2、
Select Case e.DataCol.Name Case "在读","年龄" If e.DataRow("在读") = True Then e.DataRow("GS602") = 100 Else If e.DataRow.IsNull("年龄") Then e.DataRow("GS602") = Nothing ElseIf e.DataRow("年龄")<=18 Then e.DataRow("GS602") = 100 \'年龄小于18则补助金额为100 Else e.DataRow("GS602") =180 End If End If End Select [此贴子已经被作者于2017/10/13 20:22:39编辑过]
|