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成品库存动态表两张表(子表)关联,在输入“成品库入库出库明细表”中相应产品的入库或出库数量时,如何能实现在“成品库存动态表”中同步形成“库存结余”的最终统计(即:在“成品库存动态表”中只显示红色字体部分,同一“产品库存编码”最终的统计呢?)谢谢老师!!!
老师,不好意思,我昨天的描述有误,望谅解!