以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  Datacolchenged事件求代码帮助  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=50282)

--  作者:身份不明
--  发布时间:2014/5/4 8:40:00
--  Datacolchenged事件求代码帮助

第一:

If e.DataCol.name= "实际入库数量" OrElse e.DataCol.name= "数量" Then
   If e.DataRow("实际入库数量")<e.DataRow("数量") Then
              e.DataRow("长短款")= "短款"                        
   Else If e.DataRow("实际入库数量")>e.DataRow("数量") Then
              e.DataRow("长短款")= "长款"
   Else
           e.DataRow("长短款")= ""
   End If
End If

想在以上代码上加个条件,当"数量"为空时,输入实际入库数量后,"长短款"也为空。

 

第二:

If e.DataCol.name= "入库日期" OrElse e.DataCol.name= "交货日期" Then
   If e.DataRow.Isnull("入库日期") = False Then
   If e.DataRow("入库日期")<e.DataRow("交货日期") Then
              e.DataRow("及时")= "是"
              e.DataRow("是否及时")= True
   Else If e.DataRow("入库日期")>e.DataRow("交货日期") Then
              e.DataRow("不及时")= "是"      
        End If
   End If
End If

加个条件:当"交货日期"为空时,输入入库日期后,"是否及时" "及时""不及时"三列都为空。。


--  作者:Bin
--  发布时间:2014/5/4 9:15:00
--  
If e.DataCol.name= "实际入库数量" OrElse e.DataCol.name= "数量" Then
   if e.datarow.isnull("数量") then
         e.DataRow("长短款")= ""
   else
   If e.DataRow("实际入库数量")<e.DataRow("数量") Then
              e.DataRow("长短款")= "短款"                         
   Else If e.DataRow("实际入库数量")>e.DataRow("数量") Then
              e.DataRow("长短款")= "长款"
   Else
           e.DataRow("长短款")= ""
   End If
   end if
End If











If e.DataCol.name= "入库日期" OrElse e.DataCol.name= "交货日期" Then
   If e.DataRow.Isnull("入库日期") = False andalso e.DataRow.Isnull("交货日期")=False Then
   If e.DataRow("入库日期")<e.DataRow("交货日期") Then
              e.DataRow("及时")= "是"
              e.DataRow("是否及时")= True
   Else If e.DataRow("入库日期")>e.DataRow("交货日期") Then
              e.DataRow("不及时")= "是"       
        End If
   else
    e.DataRow("及时")= ""
              e.DataRow("是否及时")= False
e.DataRow("不及时")= ""  
   End If
End If
[此贴子已经被作者于2014-5-4 9:16:13编辑过]