呵呵,4楼的代码,多了一个双引号,改一下:
e.DataRow("外协出库") = DataTables("外协加工").Compute("Sum(数量)","[零件图号] = '" & e.NewValue & "' And 出入库 = '是'") e.DataRow("外协入库") = DataTables("外协加工").Compute("Sum(数量)","[零件图号] = '" & e.NewValue & "' And 出入库 = '否'")