Foxtable(狐表)用户栏目专家坐堂 → 求个复杂点的代码


  共有23626人关注过本帖树形打印复制链接

主题:求个复杂点的代码

帅哥哟,离线,有人找我吗?
ybil
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:521 积分:4910 威望:0 精华:7 注册:2008/9/2 22:22:00
  发帖心情 Post By:2008/12/19 12:22:00 [显示全部帖子]

'''
If e.DataCol.Name = "付款单位"  Then
     Dim T As String
     Dim mny,sum As Double
     Dim Da As DataTable = DataTables("总表")
     mny = e.DataRow("金额") 
      if mny <=0 then
          MessageBox.Show("请输入金额!", "提示")
     Else    
         T = "发货单位 = '" & e.NewValue & "'"
         if Da.Find(T) isNot nothing then
               for each dr As DataRow in Da.select(T)
                       sum = Da.Compute("Sum(运费结算_已收)",T)
                       if sum = mny
                             Exit For
                       end if
                       if  mny - sum >= dr("运费结算_应收费")            
                             dr("运费结算_已收") = dr("运费结算_应收费")
                       Else
                             dr("运费结算_已收") = mny - sum
                       End if
               Next
         end if
     end if
end if
                    
[此贴子已经被作者于2008-12-19 12:58:20编辑过]

 回到顶部