以文本方式查看主题

-  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=8445)

--  作者:xjtg
--  发布时间:2010/10/25 17:56:00
--  库存表总出错?

CZY老师请帮助看一下

 

 

\'库存表MainTableChanged事件代码:
   
If MainTable.Name = "库存表" Then
    Dim f As New Filler
    f.SourceTable = DataTables("流水帐")
    f.SourceCols = "编号"
    f.datatable = DataTables("库存表")
    f.DataCols = "编号"
    f.ExcludeExistValue = True
    f.ExcludeNullValue = True
    f.Fill()
    Dim dt As datatable = DataTables("流水帐")
    For Each dr As DataRow In DataTables("库存表").DataRows
        Dim val As Decimal = dt.Compute("Max(_SortKey)","编号 = \'" & dr("编号") & "\'")
        Dim dr1 As DataRow = dt.Find("编号 = \'" & dr("编号") & "\' And _SortKey = " & val,"日期 Desc")
        dr("日期") = dr1("日期")
        dr("库存重量") = dr1("库存重量")
        dr("库存件数") = dr1("库存件数")
        dr("名称") = dr1("名称")
        dr("规格") = dr1("规格")
    Next
End If
CurrentTable.OpenFilterTree

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:库帐.table


--  作者:mr725
--  发布时间:2010/10/25 18:13:00
--  
库存表的类别列没有内容···
--  作者:xjtg
--  发布时间:2010/10/25 18:20:00
--  

库存表MainTableChanged事件代码:
类别列没关系吧?

[此贴子已经被作者于2010-10-25 18:22:15编辑过]

--  作者:czy
--  发布时间:2010/10/25 18:25:00
--  
If MainTable.Name = "库存表" Then
    Dim f As New Filler
    f.SourceTable = DataTables("流水帐")
    f.SourceCols = "编号"
    f.datatable = DataTables("库存表")
    f.DataCols = "编号"
    f.ExcludeExistValue = True
    f.ExcludeNullValue = True
    f.Fill()
    Dim dt As datatable = DataTables("流水帐")
    For Each dr As DataRow In DataTables("库存表").DataRows
        Dim val As Decimal = dt.Compute("Max(_SortKey)","编号 = \'" & dr("编号") & "\'")
        Dim dr1 As DataRow = dt.Find("编号 = \'" & dr("编号") & "\' And _SortKey = " & val,"日期 Desc")
        If dr1 IsNot Nothing Then
            dr("日期") = dr1("日期")
            dr("库存重量") = dr1("库存重量")
            dr("库存件数") = dr1("库存件数")
            dr("名称") = dr1("名称")
            dr("规格") = dr1("规格")
        End If
    Next
End If
CurrentTable.OpenFilterTree

--  作者:xjtg
--  发布时间:2010/10/25 18:38:00
--  

谢谢了,  我还要改一下结构,以后还要请教。

[此贴子已经被作者于2010-10-25 18:42:23编辑过]

--  作者:xjtg
--  发布时间:2011/1/7 8:32:00
--  我的库存帐
czy版主,用2011-01-05版如何用跨表更新?
--  作者:狐狸爸爸
--  发布时间:2011/1/7 8:35:00
--  
以下是引用xjtg在2011-1-7 8:32:00的发言:
czy版主,用2011-01-05版如何用跨表更新?

 

新版本比老版本讲得更加详细的:

 

图片点击可在新窗口打开查看


--  作者:xjtg
--  发布时间:2011/1/7 9:31:00
--  
以下是引用狐狸爸爸在2011-1-7 8:35:00的发言:

 

新版本比老版本讲得更加详细的:

 

图片点击可在新窗口打开查看

还没有理解哪.


--  作者:狐狸爸爸
--  发布时间:2011/1/7 14:53:00
--  

不明白你的意思,新版虽有更新,但是并不会导致你的代码要重写,只是更为方便而已。


--  作者:czy
--  发布时间:2011/1/10 12:13:00
--  
没发现有问题。