Export Access Objects to Text (non VBA)

There are two kinds of export that we can use to export an Access object to Text file.

Assume that we want to export Query1 to Text. Right click on the Query > Export > Text File

This page has a check box Export data with formatting and layout which determines the underlying VBA Method to be used.

If you check the box Export data with formatting and layout, you will end up getting the below ugly result.
For this option, you are using DoCmd.OutputTo Method to generate the result. We are not going to talk about this Method in this tutorial but you can click on the hyperlink to my another post.

If you leave the box unchecked, there will be more customization options, this is to use DoCmd.TransferText Method to generate the result.

In the next step, select delimit by Tab, select Text Qualifier to none (to prevent double quote around each data)

Now you get the Text file delimited by TAB.

Access VBA Export Query to Text File (one query)

As explained above, there are two kinds of export, but we do not want to ugly “formatted” result, therefore we are going to use the customizable DoCmd.TransferText Method, and use the same options above.

Now insert a Module, paste and run the below Procedure. It will export Query1 to the C:\test\ folder.