Pages

Showing posts with label Export Table To Delimit Text File. Show all posts
Showing posts with label Export Table To Delimit Text File. Show all posts

Wednesday, December 28, 2011

Export Table To Delimit Text File

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