以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  CheckedComboBox查询  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=76850)

--  作者:cwm591825
--  发布时间:2015/11/6 9:56:00
--  CheckedComboBox查询

老师:

早上好!请帮忙看看下面代码,运行时显示:

.NET Framework 版本:2.0.50727.5456
Foxtable 版本:2014.11.11.1
错误所在事件:窗口,机房生产排期,Button5,Click
详细错误信息:
未找到类型“String”的公共成员“Text”。

对于CheckedComboBox查询是第一次写代码,请帮忙看看哪里不对,谢谢!

 

Tables("机房生产排期").DataTable.Load()
Dim Filter As String
With e.Form.Controls("DateTimePicker2")
    If .Value IsNot Nothing Then
        Filter = Filter & "日期 >= #" & .Value & "#"
    End If
End With
With e.Form.Controls("DateTimePicker3")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "日期 <= #" & .Value & "#"
    End If
End With
With e.Form.Controls("ComboBox9")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter  = Filter  & " And "
        End If
        Filter  = Filter  & "机台编号 = \'" & .Value & "\'"
    End If
End With
With e.Form.Controls("ComboBox10")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "姓名 = \'" & .Value & "\'"
    End If
End With
With e.Form.Controls("ComboBox11")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "型号 = \'" & .Value & "\'"
    End If
End With
With e.Form.Controls("ComboBox12")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "模具区分 = \'" & .Value & "\'"
    End If
End With
With e.Form.Controls("ComboBox13")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "规格 = \'" & .Value & "\'"
    End If
End With
With e.Form.Controls("ComboBox14")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "颜色 = \'" & .Value & "\'"
    End If
End With
With e.Form.Controls("ComboBox15")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "材料 = \'" & .Value & "\'"
    End If
End With
With e.Form.Controls("CheckedComboBox1")
    If .Value.Text IsNot Nothing Then
        If Filter > "" Then
            Filter  = Filter & " And "
        End If
        Filter  = Filter & "班次 In ( \'" & .Value.Text.replace(",","\',\'") & "\')"
    End If
End With

If Filter > "" Then
    Tables("机房生产排期").Filter = Filter
End If


--  作者:大红袍
--  发布时间:2015/11/6 10:32:00
--  
With e.Form.Controls("CheckedComboBox1")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter  = Filter & " And "
        End If
        Filter  = Filter & "班次 In ( \'" & .Value.replace(",","\',\'") & "\')"
    End If
End With
--  作者:cwm591825
--  发布时间:2015/11/6 10:50:00
--  

谢谢!