sqltable总共3个事件有代码:prepareedit:Select Case e.Col.Name Case "G色", "A色", "B色", "C色", "D色", "E色"
Dim tr As Row = Tables("订单").Current
e.Col.ComboList = DataTables("样品物料").SQLGetComboListString("颜色", "样品编号 = '" & tr("样品编号") & "' and 样品性质 = '" & tr("样品性质") & "'")
End Select
e.Table.Save
datacolchanged:Select Case e.Col.Name
Case "G色"
If e.Row.IsNull("G色") = False Then
If cm IsNot Nothing Then
Dim cms() As String = cm.Split("|")
For i As Integer = 0 To cms.Length - 1
Tables("订单.订单明细").AddNew
tr = Tables("订单.订单明细").Current
tr("G色") = e.Row("G色")
tr("计数") = i + 1
tr("尺码") = cms(i)
Next
Tables("订单明细").Save
Else
MessageBox.Show("尚未设置尺码组!")
Return
End If
End If
Case "A色", "B色" , "C色", "D色", "E色"
If e.Row.IsNull("G色") = True Then
MessageBox.Show("主色不能为空!")
Return
Else
txt = e.Col.Name
DataTables("订单明细").ReplaceFor(txt, e.Row(txt), "生产单号 = '" & Tables("订单").Current("生产单号") & _
"' and G色 = '" & e.Row("G色") & "'")
End If
End Select
click:Tables("订单.订单明细").Filter = "G色 = '" & e.Table.Current("G色") & "'"