以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  提示错误  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=93774)

--  作者:cuicuibing
--  发布时间:2016/12/6 17:59:00
--  提示错误
Dim Filter As String
With e.Form.Controls("DropBox1")
    If .Value IsNot Nothing Then
        Filter = "内部加工单号  in (\'" & .Value.replace(",","\',\'") & "\')"
        End If
End With
With e.Form.Controls("combobox1")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "工段 = \'" & .Value & "\'"
    End If
End With
With e.Form.Controls("DropBox3")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "产品名称 = \'" & .Value & "\'"
    End If
End With

If Filter > "" Then
    DataTables("工序库调用_Table1").LoadFilter = Filter \'设置加载条件
    DataTables("工序库调用_Table1").Load()
End If
Dim cmd1 As New SQLCommand
Dim dt As DataTable
Dim Val As Double
Dim val1 As Double
Dim s As Integer
cmd1.C
cmd1.CommandText = "SELE CT * From {派工明细表} " & iif(Filter>"", "Where " & filter, "")
dt = cmd1.ExecuteReader()

For Each r As Row In Tables("工序库调用_table1").Rows
    Val = dt.SQLCompute("Sum(派工量)"," 编号= \'" & r("编号") & "\'")
    val1 = dt.SQLCompute("Sum(部件派工)"," 编号= \'" & r("编号") & "\'")
    r("可派工量") = r("工序数量") - val
    r("部件余量") = r("部件量") - val1
    
Next
Tables("工序库调用_table1").Filter = "[可派工量] > 0 "

e.Form.Controls("TreeView1").BuildTree("工序库调用_table1", "工段|工序名称|产品名称")
e.Form.Controls("TreeView2").BuildTree("工序库调用_table1", "产品名称|工段|工序名称")

--  作者:有点色
--  发布时间:2016/12/6 18:01:00
--  
提示什么错误?
--  作者:cuicuibing
--  发布时间:2016/12/6 18:03:00
--  

Dim Filter As String
With e.Form.Controls("DropBox1")
    If .Value IsNot Nothing Then
        Filter = "内部加工单号  in (\'" & .Value.replace(",","\',\'") & "\')"
        End If
End With
With e.Form.Controls("combobox1")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "工段 = \'" & .Value & "\'"
    End If
End With
With e.Form.Controls("DropBox3")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "产品名称 = \'" & .Value & "\'"
    End If
End With

If Filter > "" Then
    DataTables("工序库调用_Table1").LoadFilter = Filter \'设置加载条件
    DataTables("工序库调用_Table1").Load()
End If
Dim cmd1 As New SQLCommand
Dim dt As DataTable
Dim Val As Double
Dim val1 As Double
Dim s As Integer
cmd1.C
cmd1.CommandText = "SEL ECT * From {派工明细表} " & iif(Filter>"", "Where " & filter, "")
dt = cmd1.ExecuteReader()

For Each r As Row In Tables("工序库调用_table1").Rows
    Val = dt.SQLCompute("Sum(派工量)"," 编号= \'" & r("编号") & "\'")
    val1 = dt.SQLCompute("Sum(部件派工)"," 编号= \'" & r("编号") & "\'")
    r("可派工量") = r("工序数量") - val
    r("部件余量") = r("部件量") - val1
    
Next
Tables("工序库调用_table1").Filter = "[可派工量] > 0 "

e.Form.Controls("TreeView1").BuildTree("工序库调用_table1", "工段|工序名称|产品名称")
e.Form.Controls("TreeView2").BuildTree("工序库调用_table1", "产品名称|工段|工序名称")

不加入:Tables("工序库调用_table1").Filter = "[可派工量] > 0 ",加载没有问题


请教加入\'Tables("工序库调用_table1").Filter = "[可派工量] > 0 "这个条件时.

提示:

无法再system.string 和system.int32上执行>操作