以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]按照实例做的筛选用不了,求帮助  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=10997)

--  作者:19662206
--  发布时间:2011/7/3 23:30:00
--  [求助]按照实例做的筛选用不了,求帮助

以下是按照实例做的

 

 

窗口与控件事件

 

筛选查询_Button1_Click

 

Dim Filter As String

With e.Form.Controls("ComboBox1")

    If .Value IsNot Nothing Then

        Filter = "项目进度= \'" & .Value & "\'"

    End If

End With

With e.Form.Controls("ComboBox2")

    If .Value IsNot Nothing Then

        If Filter > "" Then

            Filter = Filter & " And "

        End If

        Filter = Filter & "专线类型 = \'" & .Value & "\'"

    End If

End With

With e.Form.Controls("ComboBox3")

    If .Value IsNot Nothing Then

        If Filter >"" Then

            Filter = Filter & " And "

        End If

        Filter = Filter & "计费 = \'" & .Value & "\'"

    End If

End With

With e.Form.Controls("ComboBox4")

    If .Value IsNot Nothing Then

        If Filter >"" Then

            Filter = Filter & " And "

        End If

        Filter = Filter & "协议 = \'" & .Value & "\'"

    End If

End With

With e.Form.Controls("DateTimePicker1")

    If .Value IsNot Nothing Then

        If Filter >"" Then

            Filter = Filter & " And "

        End If

        Filter = Filter & "需求时间 >= #" & .Value & "#"

    End If

End With

With e.Form.Controls("DateTimePicker2")

    If .Value IsNot Nothing Then

        If Filter >"" Then

            Filter = Filter & " And "

        End If

        Filter = Filter & "需求时间 <= #" & .Value & "#"

    End If

End With

If Filter > "" Then

    Tables("表A").Filter = Filter

End If

 

筛选查询_Button2_Click

 

e.Form.Controls("ComboBox1").Value = Nothing

e.Form.Controls("ComboBox2").Value = Nothing

e.Form.Controls("ComboBox3").Value = Nothing

e.Form.Controls("ComboBox4").Value = Nothing

e.Form.Controls("DateTimePicker1").Value = Nothing

e.Form.Controls("DateTimePicker2").Value = Nothing

 

筛选查询_Button3_Click

 

Tables("表A").ApplyFilter = False

 

 

谁能帮我看看有什么问题


--  作者:狐狸爸爸
--  发布时间:2011/7/4 6:40:00
--  

错图提示是什么?

记住:字符串用单引号,日期用#,数值啥也不用。

搞不定就将你设计的表和窗口传上来。


--  作者:19662206
--  发布时间:2011/7/4 10:35:00
--  

搞定了,在家里不好使,拿到单位就好使了