MYSQL数据源
执行下面代码,无法实现,主表-"订单属性"' , "采购日期" 列的'录入或修改,明细表--"订单属性"' , "采购日期" 列-也跟着录入或修改,如何才实现?
主表
Select Case e.DataCol.Name
Case "订单属性"' , "采购日期" '
Dim drs As List(Of DataRow) '
drs = e.DataRow.GetChildRows("MYSQL001_Table2")'
For Each dr As DataRow In drs
If dr("审核") = "未审核" Then '
dr(e.DataCol.Name) = e.DataRow(e.DataCol.Name)
End If
Next
End Select
If e.DataCol.Name = "采购单号" AndAlso Forms("MYSQL001").opened Then
Tables("MYSQL001_Table2").Filter = "采购单号='" & e.NewValue & "'"
End If
明细表
Select Case e.DataCol.Name
Case "订单属性", "采购日期" '
Dim pr As DataRow = e.DataRow.GetParentRow("MYSQL001_Table1")'
'Dim pr As DataRow = e.DataRow.GetParentRow("cgzb")'
If pr IsNot Nothing Then
e.DataRow("订单属性") = pr("订单属性")
e.DataRow("采购日期") = pr("采购日期")
End If
End Select