以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  统计求助  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=101644)

--  作者:xusuyang
--  发布时间:2017/6/4 21:02:00
--  统计求助
老师:您好!如所上传的:1成品库入库出库明细表;2成品库存动态表两张表,如何依据“成品库入库出库明细表”实现“成品库存动态表”中红色字体不显示,即“成品库存动态表”只显示同一“产品库存编码”最终的一行呢?谢谢老师!!!
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:成品库入库出库明细表.xls

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:成品库存动态表.xls


--  作者:有点色
--  发布时间:2017/6/4 22:43:00
--  

Dim idx As String = "-1,"
Dim idx_temp As String = ""
Dim pdr As DataRow = Nothing
Dim count As Integer = 0
Dim cs As String = "产品信息"
For Each dr As DataRow In DataTables("成品库存动态表").Select("", cs & " desc ")
   
    Dim flag As Boolean = False
    If pdr IsNot Nothing Then
        If pdr(cs).length >= 8 AndAlso dr(cs).length >= 8 AndAlso pdr(cs).substring(8) <> dr(cs).substring(8) Then
            flag = True
        End If
    End If
    If flag Then
        If count > 1 Then
            idx &= idx_temp
        End If
        count = 1
        idx_temp = ""
    Else
        count += 1
        idx_temp &= dr("_Identify") & ","
    End If
   
    pdr = dr
Next

If count > 1 Then
    idx &= idx_temp
End If
Tables("成品库存动态表").filter = "_Identify not in (" & idx.trim(",") & ")"

 


--  作者:xusuyang
--  发布时间:2017/6/5 9:25:00
--  

Dim idx As String = "-1,"
Dim idx_temp As String = ""
Dim pdr As DataRow = Nothing
Dim count As Integer = 0
Dim cs As String = "产品信息"
For Each dr As DataRow In DataTables("成品库存动态表").Select("", cs & " desc ")
   
    Dim flag As Boolean = False
    If pdr IsNot Nothing Then
        If pdr(cs).length >= 8 AndAlso dr(cs).length >= 8 AndAlso pdr(cs).substring(8) <> dr(cs).substring(8) Then
            flag = True
        End If
    End If
    If flag Then
        If count > 1 Then
            idx &= idx_temp
        End If
        count = 1
        idx_temp = ""
    Else
        count += 1
        idx_temp &= dr("_Identify") & ","
    End If
   
    pdr = dr
Next

If count > 1 Then
    idx &= idx_temp
End If
Tables("成品库存动态表").filter = "_Identify not in (" & idx.trim(",") & ")"

 

老师:您好!按上述代码,实现不了:1成品库入库出库明细表(父表)与2成品库存动态表两张表(子表)关联,在输入“成品库入库出库明细表”中相应产品的入库或出库数量时,如何能实现在“成品库存动态表”中同步形成“库存结余”的最终统计(即:在“成品库存动态表”中只显示红色字体部分,同一“产品库存编码”最终的统计呢?)谢谢老师!!!

老师,不好意思,我昨天的描述有误,望谅解!


--  作者:有点色
--  发布时间:2017/6/5 9:28:00
--  
 请上传具体foxtable实例说明。