以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  跨表更新问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=31114)

--  作者:zhangxl1964
--  发布时间:2013/4/10 13:41:00
--  跨表更新问题
老师:

If e.DataCol.Name = "产品编号" Then
    If e.NewValue Is Nothing Then
        e.
DataRow("品名") = Nothing
        e.
DataRow("型号") = Nothing
        e.
DataRow("规格") = Nothing
        
e.DataRow("单价") = Nothing

        e.DataRow("日期") = Nothing    

    Else
       
Dim dr As DataRow
        dr =
DataTables("产品").Find("[产品编号] = \'" & e.NewValue & "\'")
        If
dr IsNot Nothing

            e.
DataRow("品名") = dr("品名")
            e.
DataRow("型号") = dr("型号")
            e.
DataRow("规格") = dr("规格")
            e.
DataRow("单价") = dr("单价"

            e.DataRow("日期") = dr("日期") 
        End
If
   
End If
End
If


Select Case e.DataCol.Name
    Case
"品名","型号","规格",
"单价","日期"
       
Dim Filter As String = "[产品编号] = \'" & e.DataRow("产品编号") & "\'"
       
Dim drs As List(Of DataRow) = DataTables("订单").Select(Filter)
        For
Each dr As DataRow In
drs
            dr(e.
DataCol.Name) = e.NewValue
        Next
End
Select


    上面的代码执行后,"品名","型号","规格","单价"都能更新,唯有"日期"列没有反映,是何原因?


--  作者:XYT
--  发布时间:2013/4/10 14:10:00
--  
看下日期的列属性是否一样