Sub ExportCSV()
Dim strOut As String
Dim tbl As AccessObject
With Application.FileDialog(4)
.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.AllTables
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
附 件:
点击下载此附件
演 示: