以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=146814)

--  作者:syst
--  发布时间:2020/3/3 10:24:00
--  [求助]
老师好,有个问题请教:有一个“出库明细表”,出库数量列,以及一个关联表“出库明细_库存”的库存列。要求在填写出库数量的时候判断,所填的数量是否大于库存量。如果大于则不允许编辑。这个代码在datacolchanging里面应该怎么写呢?谢谢噢。目的就是想判断,库存没有的不得出库。
--  作者:有点蓝
--  发布时间:2020/3/3 10:38:00
--  
http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=50080

比如

If e.DataCol.Name = "出库数量" Then
    Dim
 dr As DataRow 
    dr =
DataTables("
库存").Find("商品编号 = \'" & e.datarow("商品编号") & "\'")
    If dr IsNot Nothing andalso dr("库存量") < e.newvalue Then
        MessageBox.Show("库存量不足!")
        e.Cancel = 
True
    End
 If
End
 
If

--  作者:syst
--  发布时间:2020/3/3 10:44:00
--  
哦哦收到。下次注意写清楚。谢谢哈。