Foxtable(狐表)用户栏目专家坐堂 → 筛选后如何生成一个新的数据表


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

主题:筛选后如何生成一个新的数据表

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


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2008/11/10 17:56:00 [显示全部帖子]

with e.Form
    Dim query As New QueryBuilder
    Dim dt As DataTable   
    Dim cmb1 As WinForm.ComboBox  
    Dim cmb2 As WinForm.ComboBox  
    cmb1 = .Controls("ComboBox1")  
    cmb2 = .Controls("ComboBox2") 
    If DataTables("员工资料").DataCols(cmb2.Value). IsDate  Then  
        If .Controls("DateTimePicker1").Value Is Nothing Orelse .Controls("DateTimePicker2").Value Is Nothing Then 
            Messagebox.Show("请输入完整日期","提示") 
            Return 
        End If
        query.SelectString  = "Select * from {员工资料} where " & cmb2.Value & " BETWEEN #" & .Controls("DateTimePicker1").Value & "# AND #"  & .Controls("DateTimePicker2").Value & "#"  ''
    Else 
        query.SelectString = "Select * from {员工资料} where " & cmb2.Value & " = '" & cmb1.Value & "'"
    End If
   query.Build
end with

 回到顶部