Foxtable(狐表)用户栏目专家坐堂 → 查询


  共有2427人关注过本帖树形打印复制链接

主题:查询

帅哥哟,离线,有人找我吗?
gcc123
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:407 积分:3087 威望:0 精华:0 注册:2014/6/10 11:31:00
查询  发帖心情 Post By:2014/7/11 20:49:00 [显示全部帖子]

Dim Filter As String
With e.Form.Controls("起始时间")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "日期 >= #" & .Value & "#"
    End If
End With
With e.Form.Controls("结束时间")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "日期 <= #" & .Value & "#"
    End If
End With
Dim ch As WinForm.ComboBox = e.Form.Controls("车号")
Dim cy As WinForm.ComboBox = e.Form.Controls("承运")
Dim ty As WinForm.ComboBox = e.Form.Controls("托运")
Dim sh As WinForm.ComboBox = e.Form.Controls("审核开piao")
Dim hwmc As WinForm.ComboBox = e.Form.Controls("货物名称")
Dim hd As WinForm.ComboBox = e.Form.Controls("回单")
Dim xj As WinForm.ComboBox = e.Form.Controls("现金")
Dim qd As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim zd As WinForm.ComboBox = e.Form.Controls("ComboBox2")
Tables("应付应收录入").Filter = "托运单位 = '" & ty.Text & "' And 车号 = '" & ch.Text & "' And 承运单位 = '" & cy.Text & "'"

按照一个条件或同时几个条件都能查询,最后一句过滤条件的代码应该怎么写?


 回到顶部
帅哥哟,离线,有人找我吗?
gcc123
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:407 积分:3087 威望:0 精华:0 注册:2014/6/10 11:31:00
  发帖心情 Post By:2014/7/11 21:37:00 [显示全部帖子]

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:例子.table

就是想按照一个条件或者多个条件能查询

 回到顶部
帅哥哟,离线,有人找我吗?
gcc123
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:407 积分:3087 威望:0 精华:0 注册:2014/6/10 11:31:00
  发帖心情 Post By:2014/7/12 11:11:00 [显示全部帖子]

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:例子1.table

想要的效果是,按照一个条件能查询,多个条件一起也能同时查询,包括日期在内,好像没有达到效果,老师帮着看一下


 回到顶部