Dim dr As DataRow
Dim dd As DataRow
Dim dc As DataRow
dr = DataTables("进货明细").Find("条码号 = '"& e.Form.Controls("combobox1").text & "'and 基本款号 = '" & e.Form.Controls("combobox2").text & "'")
dd= DataTables("销售表").find("条码号 = '"& e.Form.Controls("combobox1").text & "'and 基本款号 = '" & e.Form.Controls("combobox2").text & "'")
dc= DataTables("退货表").Find("条码号 = '"& e.Form.Controls("combobox1").text & "'and 退货款号 = '" & e.Form.Controls("combobox2").text & "'")
‘If dr IsNot Nothing And dd IsNot Nothing And dc IsNot Nothing Then
e.Form.Controls("label11").text = IIF(dr = Nothing ,0,dr("件数")) - IIF(dd = Nothing,0,dd("件数")) -IIF(dc = Nothing,0,dc("件数") )