以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  相关表之间,不是关联的列之间的比较与判断  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=87871)

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

 借出数量列,不能是表达式列

 

msgbox(e.DataCol.name)
If e.DataCol.name = "借出数量" Then
    Dim dr As DataRow
    Dim t As Integer
    dr = DataTables("现有库存").Find("[学科编号] = \'" & e.DataRow("学科编号") & "\'")
    If dr IsNot Nothing Then
        t = dr("现有_数量")
        msgbox(t)
        If e.NewValue > t Then
            MessageBox.Show("借出数量超过库存","提示")
            e.Cancel = True
        End If
    End If
End If