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


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

主题:多条件查询

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


加好友 发短信
等级:狐神 帖子:4752 积分:34568 威望:0 精华:0 注册:2008/8/31 22:44:00
  发帖心情 Post By:2013/8/17 8:29:00 [显示全部帖子]

雇员Enter事件:
Dim cp As WinForm.ComboBox = e.Form.Controls("产品")
Dim kh As WinForm.ComboBox = e.Form.Controls("客户")
Dim gy As WinForm.ComboBox = e.Form.Controls("雇员")
If kh.Text > ""
    gy.ComboList = DataTables("订单").GetComboListString("雇员","产品 = '" & cp.Text & "'And 客户 = '" & kh.Text & "'")
Else
    gy.ComboList = DataTables("订单").GetComboListString("雇员","产品 = '" & cp.Text & "'")
End If

查询按钮事件:
Dim ss1() As String = {e.Form.Controls("产品").text,e.Form.Controls("雇员").text,e.Form.Controls("客户").text}
Dim ss2() As String = {"产品","雇员","客户"}
Dim s As String
For i As Integer = 0 To ss1.Length - 1
    If ss1(i)>""
        s += " and " & ss2(i) & "='" & ss1(i) & "'"
    End If
Next
Tables("订单").Filter = mid(s,5)

 回到顶部