Foxtable(狐表)用户栏目专家坐堂 → [求助]列表框做窗口筛选问题


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

主题:[求助]列表框做窗口筛选问题

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


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2016/11/27 20:37:00 [显示全部帖子]

参考代码

 

Dim cmb As WinForm.ComboBox
cmb = Forms("窗口1").Controls("ComboBox1")
Dim cmb1 As WinForm.ComboBox
cmb1 = Forms("窗口1").Controls("ComboBox2")
Dim cmb2 As WinForm.ComboBox
cmb2 = Forms("窗口1").Controls("ComboBox3")
Dim filter As String = "1=1"
If cmb.Text > "" Then
    filter &= " and 序号 = '" & cmb.Text & "'"
End If
If cmb1.Text > "" Then
    filter &= " and 班组 = '" & cmb1.Text & "'"
End If
If cmb2.Text > "" Then
    filter &= " and 姓名 = '" & cmb2.Text & "'"
End If
cmb.ComboList = DataTables("表A").GetComboListString("序号", filter)
cmb1.ComboList = DataTables("表A").GetComboListString("班组", filter)
cmb2.ComboList = DataTables("表A").GetComboListString("姓名", filter)
If cmb.ComboList.Split("|").length = 1 Then
    cmb.text = cmb.ComboList
End If
If cmb1.ComboList.Split("|").length = 1 Then
    cmb1.text = cmb1.ComboList
End If
If cmb2.ComboList.Split("|").length = 1 Then
    cmb2.text = cmb2.ComboList
End If


 回到顶部