此主题相关图片如下:1.jpg
我在表属性 DataColChanged 加入代码,可是执行后,出现上面的错误提示,请专家指点:
Dim dr As DataRow = e.DataRow
Dim pr As DataRow = dr.GetParentRow("销售订单")
Select Case e.DataCol.Name
Case "柜型","柜号"
Dim T1,Ts As String
Dim Ls As List(Of String)
Dim dts As DataTable = DataTables("柜型柜号")
Ls = dts.GetUniqueValues("[销售合同号] = '" & pr("销售合同号") & "'","柜型") '从指定列中,获取不重复的值,以集合的形式返回.
For Each T1 In Ls '根据指定的表达式和条件进行计算
Ts = Ts & " " & dts.Compute("Count(柜型)","[销售合同号] = '" & pr("销售合同号") & "'and [柜型] = '" & T1.Replace("'","''") & "'") & "×" & T1
Next
pr("柜量") =Ts.substring(1) '返回从指定位置开始指定长度的子字符串
dr("柜型柜号") = dr("柜号") & "/" & dr("柜型")
End Select