以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  语法错误:“s”运算符后缺少操作数。麻烦指点一下  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=74934)

--  作者:jinzhengbe
--  发布时间:2015/9/23 8:15:00
--  语法错误:“s”运算符后缺少操作数。麻烦指点一下

.NET Framework 版本:2.0.50727.5485
Foxtable 版本:2014.11.11.1
错误所在事件:表,kucun,DataColChanged
详细错误信息:
调用的目标发生了异常。
语法错误:“s”运算符后缺少操作数。

 

代码如下, 但是好像我的字段里 没有s 这个命名啊

Select Case e.DataCol.Name
    Case "name","in","xiaoshou","jie","chuanhuo"
        Dim dr As DataRow
        Dim mr As DataRow = e.DataRow
        Dim drs As List(of DataRow)
        dr = e.DataTable.Find("[_SortKey] < " & mr("_SortKey") & " And [name] = \'" & mr("name") & "\'", "[_SortKey] Desc")
        If dr Is Nothing Then
            mr("kucun") = mr("in") - mr("xiaoshou") - mr("chuanhuo") + mr("jieru") - mr("weixin") + mr("weixin1")  - mr("jiechu") + mr("tui")
            dr = mr
        End If
        drs = e.DataTable.Select("[_SortKey] >= " & dr("_SortKey") & " And [name] = \'" & dr("name") & "\'", "[_SortKey]")
        For i As Integer = 1 To drs.Count - 1
            drs(i)("kucun") = drs(i-1)("kucun") + drs(i)("in") - drs(i)("xiaoshou") + drs(i)("jie") -drs(i)("chuanhuo")
             drs(i)("oldkucun") = drs(i-1)("kucun")
        Next
        If e.DataCol.Name = "name" AndAlso e.OldValue IsNot Nothing AndAlso e.OldValue <> e.NewValue Then
            dr = e.DataTable.Find("[_SortKey] < " & mr("_SortKey") & " And [name] = \'" & e.OldValue & "\'", "[_SortKey] Desc")
            If dr Is Nothing Then
                dr = e.DataTable.Find("[name] = \'" & e.OldValue & "\'", "[_SortKey]")
                If dr IsNot Nothing Then
                    dr("kucun") = dr("in") - dr("xiaoshou")+ dr("jieru") -dr("chuanhuo") - dr("tui") - dr("jiechu") + dr("chuanru") - dr("weixin")+ dr("weixin1")
                End If
            End If
            If dr IsNot Nothing Then
                drs = e.DataTable.Select("[_SortKey] >= " & dr("_SortKey") & " And [name] = \'" & dr("name") & "\'", "[_SortKey]")
                For i As Integer = 1 To drs.Count - 1
                    drs(i)("kucun") = drs(i-1)("kucun") + drs(i)("in") - drs(i)("xiaoshou")+ drs(i)("jieru") -drs(i)("chuanhuo")+ drs(i)("jiechu") + drs(i)("chuanru") + drs(i)("weixin1") -drs(i)("weixin")
                    drs(i)("oldkucun") = drs(i-1)("kucun")
                Next
            End If
        End If
End Select


--  作者:大红袍
--  发布时间:2015/9/23 9:32:00
--  

加入msgbox调试

 

http://www.foxtable.com/help/topics/1485.htm