老师好,以下代码是提取当前表里的行到“五金计划”表里,但是只能提取当前行,如果改成可以提取选定的多行呀,谢谢!
Dim dr As Row = Tables("生产主计划.生产BOM表").Current
If dr.DataRow("结案") = False Then
If dr.DataRow("生产单位") = "五金" Then
If dr.DataRow("提交") = "提交生产" Then
Dim fdr As DataRow = DataTables("五金计划").Find("订单号 = '" & dr("订单号") & "' and BOM序列 = '" & dr("BOM序列") & "'")
If fdr Is Nothing Then
fdr = DataTables("五金计划").AddNew()
fdr("订单号") = dr("订单号")
End If
fdr("物料代号") = dr("物料代号")
fdr("物料名称") = dr("物料名称")
fdr("规格型号") = dr("规格型号")
fdr("计划数量") = dr("需求数量")
fdr("生产交期") = dr("需求日期")
fdr("生产单位") = dr("生产单位")
fdr("属性") = dr("属性")
dr("提交") = "已提交"
dr.Locked = True
End If
End If
End If
http://www.foxtable.com/webhelp/topics/1597.htm
dim dr As Row
With Tables("生产主计划.生产BOM表")
If .TopPosition > -1 Then '如果选定区域包括数据行
For i as Integer = .TopPosition To .BottomPosition
dr = .Rows(i)
If dr.DataRow("结案") = False Then If dr.DataRow("生产单位") = "五金" Then
……
Next
End If
End With