If you want to export the table as text file.
Here is the code-
Sub export_table_to_text_file()
Dim tblname As String
Dim exportfile As String
' table to be exported to text file
tblname = "sales_detail"
exportfile = "C:\Users\ashishkoul\Desktop\learn\ashish.txt"
' check if the any excel file aready exists with same name
If Dir(exportfile) <> "" Then
MsgBox "File already exists"
Exit Sub
End If
DoCmd.TransferText acExportDelim, "", tblname, exportfile
End Sub
Download Access Database
No comments:
Post a Comment