每次点击一次按钮往“排单状态”表中插入一行记录,那么,当“排单状态”表中存在相同的订单号或物供号的时候,不插入一行新的,就在相同订单号或物供号的行的某列中写入新值,要怎么写?
Dim Result As DialogResult
Result = MessageBox.Show("确定要将选定的行所对应的款资料添加到已下单甘特图?","提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.Yes Then
Dim nma() As String = {"物供号","系列名","客款号","颜色"} 'A表数据来源列
Dim t As Table = Tables("dbscmx")
Dim zt As Table = Tables("排单状态")
For i As Integer = t.TopPosition To t.BottomPosition
Dim dr As Row = t.rows(i)
Dim r As Row = Tables("生产计划").addnew()
Dim dz As Row = t.rows(i)
Dim zj As Row = Tables("排单状态").addnew()
Dim str As String = ""
For n As Integer = 0 To nma.length -1
str &= dr(nma(n)) & "-"
Next
str &= t.Compute("sum(订单合计)", "厂号 = '" & dr("厂号") & "'")
r("排产内容")= str
zj("物供号")=dz("物供号")
zj("订单号")=dz("订单号")
zj("排产甘特图")="已排单"
Next
End If
Tables("排单状态").Save()
Tables("生产计划").Save()
Forms("排产").show()