执行下面代码,看弹出的信息是否正确。
If Forms("下采购订单").opened
msgbox(123)
Dim dr2 As DataRow
dr2= DataTables("采购明细表").Find("[采购单号] = '" & Tables("下采购订单_table1").current("采购单号") & "'")
msgbox("[采购单号] = '" & Tables("下采购订单_table1").current("采购单号") & "'")
Dim dr As DataRow
dr = DataTables("采购需求").Find("[物料基本信息_物料ID] = '" & dr2("物料基本信息_物料ID") & "'")
msgbox("[物料基本信息_物料ID] = '" & dr2("物料基本信息_物料ID") & "'")
If dr IsNot Nothing Then
msgbox(456)
dr.Locked = False '解锁行
dr("订料数") = dr2("订料数")
End If
dr.Locked = True '锁定行
End If