|
2#
楼主 |
发表于 2020-2-17 10:03:08
|
只看该作者
Private Sub Command0_Click()
Call ExportExcelCSV
End Sub
Sub ExportExcelCSV()
Dim strOut As String
Dim tbl As AccessObject
With Application.FileDialog(4) ' msoFileDialogFolderPicker
.Title = "Please select the target folder"
If .Show Then
strOut = .SelectedItems(1)
If Not Right(strOut, 1) = "\" Then
strOut = strOut & "\"
End If
Else
MsgBox "You didn't select a target folder.", vbExclamation
Exit Sub
End If
End With
For Each tbl In CurrentData.AllQueries
If Not tbl.Name Like "MSys*" And Not tbl.Name Like "~" Then
DoCmd.TransferText acExportDelim, , _
tbl.Name, strOut & tbl.Name & ".csv", True
End If
Next tbl
End Sub
|
|