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


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

主题:多条件查询

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


加好友 发短信
等级:幼狐 帖子:124 积分:963 威望:0 精华:0 注册:2015/1/20 15:14:00
  发帖心情 Post By:2018/4/7 0:29:00 [显示全部帖子]

Dim Filter As String
With e.Form.Controls("品名")
    If .Value IsNot Nothing Then
        Filter = Filter &   "品名 like '%" & .Value &   "%'"
    End If
End With
With e.Form.Controls("生产厂家")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If 
         Filter = Filter &   "生产厂家 like '%" & .Value &   "%'"
    End If
End With
With e.Form.Controls("规格")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If 
         Filter = Filter &   "规格 like '%" & .Value &   "%'"
    End If
End With
With e.Form.Controls("备注")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If 
         Filter = Filter &   "备注 like '%" & .Value &   "%'"
    End If
End With

If Filter > "" Then
    Tables("表A").Filter = Filter
End If

 回到顶部