以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  识别+个数,并在子表中添加相应明细个数  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=73142)

--  作者:JPG7
--  发布时间:2015/8/13 10:43:00
--  识别+个数,并在子表中添加相应明细个数

button-click

订单主表中规格列内容为 1N+2N+3N

识别出两个“+”后怎么

Dim dr As Row = Tables("订单").Current
    If dr("核销") = False Then
        Dim str As String = dr("规格")
        Dim m As Integer = str.split("+").length-1

如何在订单明细中,新增“+”数+1行(3行)

并且Dim dr2 As Row = Tables("订单.订单明细").AddNew()

dr2("型号") = dr("型号") \'由于型号牵扯到其他表关联不能使用表达式

3条明细的规格分别是 1N、2N、3N

 


--  作者:大红袍
--  发布时间:2015/8/13 10:52:00
--  
Dim dr As Row = Tables("订单").Current
If dr("核销") = False Then
    Dim str As String = dr("规格")
   
    Dim ary() As String = str.split("+")
    For each s As String In ary
        Dim dr2 As Row = Tables("订单.订单明细").AddNew()
       
        dr2("型号") = dr("型号") \'由于型号牵扯到其他表关联不能使用表达式
        dr2("规格") = s
    Next
End If

--  作者:JPG7
--  发布时间:2015/8/13 15:16:00
--  
以下是引用大红袍在2015/8/13 10:52:00的发言:
Dim dr As Row = Tables("订单").Current
If dr("核销") = False Then
    Dim str As String = dr("规格")
   
    Dim ary() As String = str.split("+")
    For each s As String In ary
        Dim dr2 As Row = Tables("订单.订单明细").AddNew()
       
        dr2("型号") = dr("型号") \'由于型号牵扯到其他表关联不能使用表达式
        dr2("规格") = s
    Next
End If

谢谢