This video shows the VBA code to export a Microsoft Access table as a text file. Access normally makes you create a custom text export for every table you create. This code allows you to export any table by just feeding the string name of the table as a variable.
I also posted the code below here to copy and paste
Public Function ExportText()
'This function exports the current table as a text file
Dim z As Long
Dim LineOfText As String
Dim Delimiter As String
Dim x As String
x = "ExampleTable"
Delimiter = vbTab
strOutputFileName = "Your_Unique_Path"
Open strOutputFileName For Output As #1
Set rs = CurrentDb.OpenRecordset(x)
With rs
For z = 0 To .Fields.Count - 1
LineOfText = LineOfText & .Fields(z).Name & Delimiter
Next z
Print #1, LineOfText
LineOfText = ""
Do While Not .EOF
For z = 0 To .Fields.Count - 1
LineOfText = LineOfText & Nz(.Fields(z)) & Delimiter
Next z
Print #1, LineOfText
LineOfText = ""
.MoveNext
Loop
End With
Close #1
End Function
![](https://i.ytimg.com/vi/nIWnZKwpjt4/maxresdefault.jpg)