|
5#
楼主 |
发表于 2010-1-10 21:52:24
|
只看该作者
4# tz-chf
Dim i As Integer
Dim rst As New ADODB.Recordset
rst.Open "BASEMPS排产计划订单", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
For i = 0 To ctGrid1.ItemCount - 1
If ctGrid1.ItemSelect(i) = True Then
rst.AddNew
' rst("流水单号ID") = Forms![frmERPlib]![Child1]![流水单号]
rst("流水单号ID") = form_.流水单号
rst("销售订单") = DLookup("销售订单", "QUERY生产补料档案", "补料NO = '" & gridtxt & "'")
rst("模具编码") = "99999缓冲模具"
rst("物料编码") = "9999999999"
rst("物料名称") = "缓冲物料名称"
rst("生产订单数量") = "1"
rst("单重") = DLookup("应领数量", "QUERY生产补料档案", "补料NO = '" & gridtxt & "'")
rst("重量") = DLookup("应领数量", "QUERY生产补料档案", "补料NO = '" & gridtxt & "'")
rst("物料规格") = "缓冲物料规格"
' rst("自动编号ID") = ctGrid1.CellText(i, 7)
ctGrid1.ItemSelect(i) = False
End If
Next
DoCmd.close
rst.Update |
|