Foxtable(狐表)用户栏目专家坐堂 → [求助]关于导出数据


  共有3467人关注过本帖平板打印复制链接

主题:[求助]关于导出数据

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/5/15 21:52:00 [只看该作者]

Dim Filter As String
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("基本信息表").Filter = Filter
End If
Dim dlg As New SaveFileDialog '定义一个新的SaveFileDialog
dlg.Filter= "Access文件|*.mdb" '设置筛选器
If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
    If FileSys.FileExists(dlg.FileName) Then
        FileSys.DeleteFile(dlg.FileName, 2, 2)
    End If
    Dim ex As New Exporter
    ex.SourceTableName = "基本信息表" '指定导出表
    ex.Filter = filter
    ex.filepath = dlg.FileName  '指定目标文件
    ex.Filter = Filter
    ex.Export() '开始导出
End If


 回到顶部
总数 31 1 2 3 4 下一页