Foxtable(狐表)用户栏目专家坐堂 → 关于日期列的年份筛选


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

主题:关于日期列的年份筛选

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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
关于日期列的年份筛选  发帖心情 Post By:2016/7/28 17:53:00 [显示全部帖子]

Dim cj As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim dm As WinForm.ComboBox = e.Form.Controls("ComboBox2")
Dim hm As WinForm.ComboBox = e.Form.Controls("ComboBox3")
If cj.SelectedItem IsNot Nothing Then
    If dm.SelectedItem IsNot Nothing Then
        If hm.SelectedItem IsNot Nothing Then
            e.sender.ComboList = DataTables("开piao主表").GetComboListString(Year(开piao日期) ,"客户名称 = '"& cj.text &"'and fa piao代码 = '"& dm.text &"'and fa piao号码 = '"& hm.text &"'","_identify")
        Else
            e.sender.ComboList = DataTables("开piao主表").GetComboListString(Year(开piao日期)  ,"客户名称 = '"& cj.text &"'and fa piao代码 = '"& dm.text &"'","_identify")
        End If
    Else
        If hm.SelectedItem IsNot Nothing Then
            e.sender.ComboList = DataTables("开piao主表").GetComboListString(Year(开piao日期) ,"客户名称 = '"& cj.text &"'and fa piao号码 = '"& hm.text &"'","_identify")
        Else
            e.sender.ComboList = DataTables("开piao主表").GetComboListString(Year(开piao日期)  ,"客户名称 = '"& cj.text &"'","_identify")
        End If
    End If
Else
    If dm.SelectedItem IsNot Nothing Then
        If hm.SelectedItem IsNot Nothing Then
            e.sender.ComboList = DataTables("开piao主表").GetComboListString(Year(开piao日期) ," fa piao代码 = '"& dm.text &"'and fa piao号码 = '"& hm.text &"'","_identify")
        Else
            e.sender.ComboList = DataTables("开piao主表").GetComboListString(Year(开piao日期)  ," fa piao代码 = '"& dm.text &"'","_identify")
        End If
    Else
        If hm.SelectedItem IsNot Nothing Then
            e.sender.ComboList = DataTables("开piao主表").GetComboListString(Year(开piao日期) ," fa piao号码 = '"& dm.text &"'","_identify")
        Else
            e.sender.ComboList = DataTables("开piao主表").GetComboListString(Year(开piao日期)  ,"","_identify")
        End If
    End If
End If

 

帮我改一下吧,Year(开piao日期) 有问题,出现错误:


图片点击可在新窗口打开查看此主题相关图片如下:cw.jpg
图片点击可在新窗口打开查看

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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2016/7/28 21:01:00 [显示全部帖子]

晕,这句代码不会写,不知道怎么加上去


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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2016/7/29 11:30:00 [显示全部帖子]

Dim cj As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim dm As WinForm.ComboBox = e.Form.Controls("ComboBox2")
Dim hm As WinForm.ComboBox = e.Form.Controls("ComboBox3")
Dim kpn As WinForm.ComboBox = e.Form.Controls("ComboBox4")
If cj.text IsNot Nothing
    If dm.text IsNot Nothing
        If hm.text IsNot Nothing
        Tables("开piao主表").Filter = "年 = '" & kpn.Text & "'and fa piao号码 = '" & hm.Text & "'and fa piao代码 like '%" & dm.Text & "%'and 客户名称 like '%" & cj.Text & "%'"
        Else
        Tables("开piao主表").Filter = "年 = '" & kpn.Text & "'and fa piao代码 = '" & dm.Text & "'and 客户名称 like '%" & cj.Text & "%'"
        End If
    Else
        If hm.text IsNot Nothing
        Tables("开piao主表").Filter = "年 = '" & kpn.Text & "'and fa piao号码 = '" & hm.Text & "'and 客户名称 like '%" & cj.Text & "%'"
        Else
        Tables("开piao主表").Filter = "年 = '" & kpn.Text & "'and 客户名称 like '%" & cj.Text & "%'"
        End If
   End If
Else
    If dm.text IsNot Nothing
        If hm.text IsNot Nothing
        Tables("开piao主表").Filter = "年 = '" & kpn.Text & "'and fa piao号码 = '" & hm.Text & "'and fa piao代码 like '%" & dm.Text & "%'"
        Else
        Tables("开piao主表").Filter = "年 = '" & kpn.Text & "'and fa piao代码 = '" & dm.Text & "'"
        End If
    Else
        If hm.text IsNot Nothing
        Tables("开piao主表").Filter = "年 = '" & kpn.Text & "'and fa piao号码 = '" & hm.Text & "'"
        Else
        Tables("开piao主表").Filter = "年 = '" & kpn.Text & "'"
        End If
   End If
End If

 

用了表达式,这筛选怎么就没反应了呢?


 回到顶部