Foxtable(狐表)用户栏目专家坐堂 → 查询结果不符合要求


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

主题:查询结果不符合要求

美女呀,离线,留言给我吧!
zbdxnyy
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:1 积分:76 威望:0 精华:0 注册:2018/4/1 19:19:00
查询结果不符合要求  发帖心情 Post By:2018/4/1 19:42:00 [只看该作者]

为什么输入“小白”和“进口”会出现表中结果,查询按钮事件代码如下
Dim Filter As String
Dim myfs As winForm.TextBox=e.Form.Controls("贸易方式")
If myfs.Value IsNot Nothing Then
Filter = " 贸易方式='"& myfs.Value &"'"
End If
Dim khmc As winForm.TextBox=e.Form.Controls("客户名称")
If khmc.Value IsNot Nothing Then
 Filter =" 客户名称='"& khmc.Value &"'"
End If
Dim khzh As winForm.TextBox=e.Form.Controls("客户账户")
If khzh.Value IsNot Nothing Then
Filter =" 客户账户='"& khzh.Value &"'"
End If
Dim hth As winForm.TextBox=e.Form.Controls("合同号")
If hth.Value IsNot Nothing Then
 Filter = " 合同号='"& hth.Value &"'"
End If
If Filter > "" Then
 Tables("记录表
图片点击可在新窗口打开查看此主题相关图片如下:微信图片_20180401192540.png
图片点击可在新窗口打开查看
").Filter=Filter


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/4/1 20:17:00 [只看该作者]

代码这样写

 


Dim Filter As String = "1=1"
Dim myfs As winForm.TextBox=e.Form.Controls("贸易方式")
If myfs.Value IsNot Nothing Then
    Filter &= "  and 贸易方式='"& myfs.Value &"'"
End If
Dim khmc As winForm.TextBox=e.Form.Controls("客户名称")
If khmc.Value IsNot Nothing Then
    Filter &=" and 客户名称='"& khmc.Value &"'"
End If
Dim khzh As winForm.TextBox=e.Form.Controls("客户账户")
If khzh.Value IsNot Nothing Then
    Filter &=" and 客户账户='"& khzh.Value &"'"
End If
Dim hth As winForm.TextBox=e.Form.Controls("合同号")

If hth.Value IsNot Nothing Then
    Filter &= " and 合同号='"& hth.Value &"'"
End If
Tables("记录表").Filter=Filter


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/4/1 20:18:00 [只看该作者]


 回到顶部