Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共3 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[求助]按照实例做的筛选用不了,求帮助

1楼
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

 

 

谁能帮我看看有什么问题

2楼
狐狸爸爸 发表于:2011/7/4 6:40:00

错图提示是什么?

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

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

3楼
19662206 发表于:2011/7/4 10:35:00

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

共3 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .02200 s, 2 queries.